2 * GStreamer codec plugin for Tizen Emulator.
4 * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved.
7 * KiTae Kim <kt920.kim@samsung.com>
8 * SeokYeon Hwang <syeon.hwang@samsung.com>
9 * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
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.
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.
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.
31 #ifndef __GST_EMUL_H__
32 #define __GST_EMUL_H__
40 #include <sys/ioctl.h>
46 GST_DEBUG_CATEGORY_EXTERN (emul_debug);
47 #define GST_CAT_DEFAULT emul_debug
51 #define CODEC_DEV "/dev/newcodec"
54 #define CODEC_PARAM_INIT(var) \
55 memset (&var, 0x00, sizeof(var))
57 #define CODEC_WRITE_TO_QEMU(fd, var, size) \
58 if (write (fd, var, size) < 0) { \
59 printf ("[%d] failed to copy data.\n", __LINE__); \
62 #define FF_INPUT_BUFFER_PADDING_SIZE 8
63 #define FF_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
64 #define FF_MIN_BUFFER_SIZE 16384
66 typedef struct _CodecIOParams {
71 uint32_t device_mem_offset;
74 typedef struct _CodecDevice {
80 typedef struct _CodecElement {
91 int8_t sample_fmts[8];
97 typedef struct _VideoData {
104 typedef struct _AudioData {
105 int channels, sample_rate;
106 int bit_rate, block_align;
107 int depth, sample_fmt;
108 int64_t channel_layout;
111 typedef struct _CodecContext {
121 enum CODEC_FUNC_TYPE {
122 CODEC_ELEMENT_INIT = 1,
132 CODEC_CMD_GET_VERSION = 5,
133 CODEC_CMD_GET_DEVICE_MEM,
134 CODEC_CMD_SET_DEVICE_MEM,
135 CODEC_CMD_GET_MMAP_OFFSET,
136 CODEC_CMD_SET_MMAP_OFFSET,
139 enum CODEC_MEDIA_TYPE {
140 AVMEDIA_TYPE_UNKNOWN = -1,
146 CODEC_TYPE_UNKNOWN = -1,
152 SAMPLE_FMT_NONE = -1,
161 /* Define codec types.
162 * e.g. FFmpeg, x264, libvpx and etc.