Changed a way to use device memory.
[platform/adaptation/emulator/gst-plugins-emulator.git] / src / gstemulapi.h
1 /*
2  * GStreamer codec plugin for Tizen Emulator.
3  *
4  * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  * KiTae Kim <kt920.kim@samsung.com>
8  * SeokYeon Hwang <syeon.hwang@samsung.com>
9  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the
23  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  * Boston, MA 02111-1307, USA.
25  *
26  * Contributors:
27  * - S-Core Co., Ltd
28  *
29  */
30
31 #ifndef __GST_EMUL_API_H__
32 #define __GST_EMUL_API_H__
33
34 #include "gstemulcommon.h"
35
36 int emul_avcodec_init (CodecContext *ctx, CodecElement *codec,
37   CodecDevice *dev);
38
39 void emul_avcodec_deinit (CodecContext *ctx, CodecDevice *dev);
40
41 int emul_avcodec_decode_video (CodecContext *ctx, uint8_t *in_buf, int in_size,
42     gint idx, gint64 in_offset, GstBuffer **out_buf,
43     int *got_picture_ptr, CodecDevice *dev);
44
45
46 int emul_avcodec_decode_audio (CodecContext *ctx, int16_t *samples,
47   int *frame_size_ptr, uint8_t *in_buf,
48   int in_size, CodecDevice *dev);
49
50 int emul_avcodec_encode_video (CodecContext *ctx, uint8_t*out_buf, int out_size,
51                 uint8_t *in_buf, int in_size, int64_t in_timestamp, CodecDevice *dev);
52
53 int emul_avcodec_encode_audio (CodecContext *ctx, uint8_t *out_buf,
54                           int out_size, uint8_t *in_buf,
55                           int in_size, CodecDevice *dev);
56
57 void emul_av_picture_copy (CodecContext *ctx, uint8_t *pict, uint32_t pict_size, CodecDevice *dev);
58
59 void emul_codec_write_to_qemu (int ctx_index, int api_index, CodecDevice *dev);
60
61 GstFlowReturn emul_buffer_alloc(GstPad *pad, guint64 offset, guint size, GstCaps *caps, GstBuffer **buf);
62
63 #endif /* __GST_EMUL_API_H__ */