Add tool package to separate testsuite binary
[platform/core/multimedia/libmm-streamrecorder.git] / src / mm_streamrecorder_buffer_manager.c
1 /*
2  * libmm-streamrecorder
3  *
4  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Hyuntae Kim <ht1211.kim@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 /*=======================================================================================
23 |  INCLUDE FILES                                                                        |
24 =======================================================================================*/
25 #include <mm_types.h>
26 #include <mm_error.h>
27 #include <mm_message.h>
28 #include "mm_streamrecorder_video.h"
29 #include "mm_streamrecorder_util.h"
30 #include "mm_streamrecorder_buffer_manager.h"
31 #include "mm_streamrecorder_internal.h"
32 #include "mm_streamrecorder_gstdispatch.h"
33
34 /*---------------------------------------------------------------------------------------
35 |    GLOBAL VARIABLE DEFINITIONS for internal                                           |
36 ---------------------------------------------------------------------------------------*/
37
38 /*---------------------------------------------------------------------------------------
39 |    LOCAL VARIABLE DEFINITIONS for internal                                            |
40 ---------------------------------------------------------------------------------------*/
41
42 /*-----------------------------------------------------------------------
43 |    GLOBAL VARIABLE DEFINITIONS for internal                           |
44 -----------------------------------------------------------------------*/
45
46 void _mmstreamrecorder_buffer_destroy(gpointer p_stream_buffer)
47 {
48         _MMStreamRecorderMsgItem msg;
49         GstStreamRecorderBuffer *stream_buffer = (GstStreamRecorderBuffer *) p_stream_buffer;
50
51         msg.id = MM_MESSAGE_STREAMRECORDER_CONSUME_COMPLETE;
52         msg.param.union_type = MM_MSG_UNION_CONSUME_RECORDER_BUFFER;
53         msg.param.consumed_mediabuffer.consumed_buffer = stream_buffer->user_buffer;
54         _mmstreamrecorder_send_message(stream_buffer->str_handle, &msg);
55         free(stream_buffer);
56         return;
57 }