4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_CAMCORDER_VIDEOREC_H__
23 #define __MM_CAMCORDER_VIDEOREC_H__
25 /*=======================================================================================
27 ========================================================================================*/
34 /*=======================================================================================
35 | GLOBAL DEFINITIONS AND DECLARATIONS FOR CAMCORDER |
36 ========================================================================================*/
38 /*=======================================================================================
40 ========================================================================================*/
42 /*=======================================================================================
44 ========================================================================================*/
46 PUSH_ENCODING_BUFFER_INIT = 0,
47 PUSH_ENCODING_BUFFER_RUN,
48 PUSH_ENCODING_BUFFER_STOP,
51 /*=======================================================================================
52 | STRUCTURE DEFINITIONS |
53 ========================================================================================*/
55 * MMCamcorder information for video(preview/recording) mode
58 gboolean b_commiting; /**< Is it commiting now? */
59 char *filename; /**< recorded filename */
60 double record_timestamp_ratio; /**< timestamp ratio of video recording for slow/fast motion recording */
61 double record_motion_rate; /**< motion rate of video recording for slow/fast motion recording */
62 GstClockTime prev_preview_ts; /**< previous preview frame timestamp */
63 GstClockTime prev_video_ts; /**< previous video frame timestamp */
64 guint record_drop_count; /**< drop count of video recording for slow/fast motion recording */
65 guint64 video_frame_count; /**< current video frame */
66 guint64 audio_frame_count; /**< current audio frame */
67 guint64 filesize; /**< current file size */
68 guint64 max_size; /**< max recording size */
69 guint64 max_time; /**< max recording time */
70 int fileformat; /**< recording file format */
71 int push_encoding_buffer; /**< ready to record flag */
72 int preview_width; /**< preview width */
73 int preview_height; /**< preview height */
74 int video_width; /**< video width */
75 int video_height; /**< video height */
76 int fps; /**< fps in videosrc caps */
78 gboolean support_dual_stream; /**< support dual stream flag */
79 gboolean record_dual_stream; /**< record with dual stream flag */
80 gboolean restart_preview; /**< flag for whether restart preview or not when start recording */
81 pthread_mutex_t size_check_lock;/**< mutex for checking recording size */
82 } _MMCamcorderVideoInfo;
84 /*=======================================================================================
85 | CONSTANT DEFINITIONS |
86 ========================================================================================*/
88 /*=======================================================================================
90 ========================================================================================*/
92 /*=======================================================================================
93 | EXTERN GLOBAL VARIABLE |
94 ========================================================================================*/
96 /*=======================================================================================
97 | GLOBAL FUNCTION PROTOTYPES |
98 ========================================================================================*/
100 * This function creates recorder pipeline.
101 * When application creates initial pipeline, there are only bins for preview.
102 * If application wants to record, recorder pipeline should be created.
104 * @param[in] handle Handle of camcorder context.
105 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
107 * @see __mmcamcorder_create_preview_pipeline()
109 int _mmcamcorder_create_recorder_pipeline(MMHandleType handle);
112 * This function connects video stream cb signal.
114 * @param[in] handle Handle of camcorder context.
115 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
118 int _mmcamcorder_connect_video_stream_cb_signal(MMHandleType handle);
121 * This function remove recorder bin from main pipeline.
123 * @param[in] handle Handle of camcorder context.
124 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
126 * @see __mmcamcorder_create_preview_pipeline(), __mmcamcorder_add_recorder_pipeline()
128 int _mmcamcorder_remove_recorder_pipeline(MMHandleType handle);
131 * This function operates each command on video mode.
133 * @param[in] handle Handle of camcorder context.
134 * @param[in] command command type received from Multimedia Framework.
135 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
137 * @see _mmcamcorder_set_functions()
139 int _mmcamcorder_video_command(MMHandleType handle, int command);
142 * This function handles EOS(end of stream) when commit video recording.
144 * @param[in] handle Handle of camcorder context.
145 * @return This function returns TRUE on success, or FALSE on failure.
147 * @see _mmcamcorder_set_functions()
149 int _mmcamcorder_video_handle_eos(MMHandleType handle);
152 * This function prepares video recording
154 * @param[in] handle Handle of camcorder context.
155 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
158 int _mmcamcorder_video_prepare_record(MMHandleType handle);
165 #endif /* __MM_CAMCORDER_VIDEOREC_H__ */