4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyuntae Kim <ht1211.kim@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_STREAMRECORDER_RECORDER_H__
23 #define __MM_STREAMRECORDER_RECORDER_H__
25 /*=======================================================================================
27 ========================================================================================*/
29 #include "mm_streamrecorder_gstdispatch.h"
35 /*=======================================================================================
36 | GLOBAL DEFINITIONS AND DECLARATIONS FOR STREAMCORDER |
37 ========================================================================================*/
39 /*=======================================================================================
41 ========================================================================================*/
43 /*=======================================================================================
45 ========================================================================================*/
47 /*=======================================================================================
48 | STRUCTURE DEFINITIONS |
49 ========================================================================================*/
51 /*=======================================================================================
52 | CONSTANT DEFINITIONS |
53 ========================================================================================*/
55 /*=======================================================================================
57 ========================================================================================*/
59 /*=======================================================================================
60 | EXTERN GLOBAL VARIABLE |
61 ========================================================================================*/
63 /*=======================================================================================
64 | GLOBAL FUNCTION PROTOTYPES |
65 ========================================================================================*/
68 * This function create main pipeline according to type.
70 * @param[in] handle Handle of streamrecorder context.
71 * @param[in] type Allocation type of streamrecorder context.
72 * @return This function returns zero on success, or negative value with error code.
74 * @see _mmstreamrecorder_destroy_pipeline()
77 int _mmstreamrecorder_create_pipeline(MMHandleType handle);
80 * This function release all element of main pipeline according to type.
82 * @param[in] handle Handle of streamrecorder context.
83 * @param[in] type Allocation type of streamrecorder context.
86 * @see _mmstreamrecorder_create_pipeline()
89 void _mmstreamrecorder_destroy_pipeline(MMHandleType handle);
92 * This function creates recorder pipeline.
93 * When application creates initial pipeline, there are only bins for preview.
94 * If application wants to record, recorder pipeline should be created.
96 * @param[in] handle Handle of streamrecorder context.
97 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
100 int _mmstreamrecorder_create_recorder_pipeline(MMHandleType handle);
103 * This function creates bin of audio source.
104 * Basically, main pipeline of streamrecorder is composed of several bin(a bundle
105 * of elements). Each bin operates its own function. This bin has a roll
106 * inputting audio data from audio source(such as mike).
108 * @param[in] handle Handle of streamrecorder context.
109 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
112 int _mmstreamrecorder_create_audiosrc_bin(MMHandleType handle);
114 int _mmstreamrecorder_destroy_audiosrc_bin(MMHandleType handle);
117 * This function creates outputsink bin.
119 * @param[in] handle Handle of streamrecorder context.
120 * @param[in] profile profile of encodesinkbin.
121 * @return This function returns MM_ERROR_NONE on success, or the other values on error.
124 int _mmstreamrecorder_create_encodesink_bin(MMHandleType handle, MMStreamRecorderEncodebinProfile profile);
126 int _mmstreamrecorder_destroy_encodesink_bin(MMHandleType handle);
129 * This function handles EOS(end of stream) when commit video recording.
131 * @param[in] handle Handle of streamrecorder context.
132 * @return This function returns TRUE on success, or FALSE on failure.
134 * @see _mmstreamrecorder_set_functions()
136 int _mmstreamrecorder_video_handle_eos(MMHandleType handle);
138 int _mmstreamrecorder_destroy_recorder_pipeline(MMHandleType handle);
141 int _mmstreamrecorder_video_command(MMHandleType handle, int command);
143 int _mmstreamrecorder_push_videostream_buffer(MMHandleType handle, unsigned long timestamp, GstBuffer *buffer, int size);
144 int _mmstreamrecorder_push_audiostream_buffer(MMHandleType handle, unsigned long timestamp, GstBuffer *buffer, int size);
150 #endif /* __MM_STREAMRECORDER_RECORDER_H__ */