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 base_video_ts; /**< base 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 */
77 gboolean is_firstframe;
78 gboolean get_first_I_frame; /**< start flag for H.264 preview recording */
79 gboolean support_dual_stream; /**< support dual stream flag */
80 gboolean record_dual_stream; /**< record with dual stream flag */
81 gboolean restart_preview; /**< flag for whether restart preview or not when start recording */
82 GMutex size_check_lock; /**< mutex for checking recording size */
83 } _MMCamcorderVideoInfo;
85 /*=======================================================================================
86 | CONSTANT DEFINITIONS |
87 ========================================================================================*/
89 /*=======================================================================================
91 ========================================================================================*/
93 /*=======================================================================================
94 | EXTERN GLOBAL VARIABLE |
95 ========================================================================================*/
97 /*=======================================================================================
98 | GLOBAL FUNCTION PROTOTYPES |
99 ========================================================================================*/
101 * This function creates recorder pipeline.
102 * When application creates initial pipeline, there are only bins for preview.
103 * If application wants to record, recorder pipeline should be created.
105 * @param[in] handle Handle of camcorder context.
106 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
108 * @see __mmcamcorder_create_preview_pipeline()
110 int _mmcamcorder_create_recorder_pipeline(MMHandleType handle);
113 * This function connects video stream cb signal.
115 * @param[in] handle Handle of camcorder context.
116 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
119 int _mmcamcorder_connect_video_stream_cb_signal(MMHandleType handle);
122 * This function remove recorder bin from main pipeline.
124 * @param[in] handle Handle of camcorder context.
125 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
127 * @see __mmcamcorder_create_preview_pipeline(), __mmcamcorder_add_recorder_pipeline()
129 int _mmcamcorder_remove_recorder_pipeline(MMHandleType handle);
132 * This function operates each command on video mode.
134 * @param[in] handle Handle of camcorder context.
135 * @param[in] command command type received from Multimedia Framework.
136 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
138 * @see _mmcamcorder_set_functions()
140 int _mmcamcorder_video_command(MMHandleType handle, int command);
143 * This function handles EOS(end of stream) when commit video recording.
145 * @param[in] handle Handle of camcorder context.
146 * @return This function returns TRUE on success, or FALSE on failure.
148 * @see _mmcamcorder_set_functions()
150 int _mmcamcorder_video_handle_eos(MMHandleType handle);
153 * This function prepares video recording
155 * @param[in] handle Handle of camcorder context.
156 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
159 int _mmcamcorder_video_prepare_record(MMHandleType handle);
166 #endif /* __MM_CAMCORDER_VIDEOREC_H__ */