*
*/
-#include <stdio.h>
-#include <sys/types.h>
-#include "hw.h"
-#include "kvm.h"
-#include "pci.h"
-#include "pci_ids.h"
-#include "qemu-thread.h"
-#include "qemu-common.h"
-#include "libavformat/avformat.h"
-#include "osutil.h"
-#include "maru_device_ids.h"
#include "maru_new_codec.h"
-#include "tizen/src/debug_ch.h"
+#include "qemu-common.h"
+#include "osutil.h"
/* define debug channel */
MULTI_DEBUG_CHANNEL(qemu, new_codec);
#define DEFAULT_VIDEO_GOP_SIZE 15
-#ifdef CODEC_DEBUG
+#ifdef CODEC_DEBUG
#include <sys/time.h>
#define CODEC_CURRENT_TIME \
{ \
static void new_codec_picture_copy(NewCodecState *s, int ctx_id, int f_id);
static AVCodecParserContext *new_codec_parser_init(AVCodecContext *avctx);
+#if 0
static int new_codec_parser_parse (AVCodecParserContext *pctx, AVCodecContext *avctx,
uint8_t *inbuf, int inbuf_size,
int64_t pts, int64_t dts, int64_t pos);
+#endif
static void *new_codec_dedicated_thread(void *opaque);
static void *new_codec_pop_readqueue(NewCodecState *s, int32_t file_index);
TRACE("read data as many as %d size from guest\n", readbuf_size);
if (readbuf_size <= 0) {
- ERR("readbuf size is smaller than zero. %d\n", readbuf_size);
+ TRACE("readbuf size is smaller than zero. %d\n", readbuf_size);
} else {
readbuf = g_malloc0(readbuf_size);
if (!readbuf) {
qemu_mutex_unlock(&s->context_queue_mutex);
}
+#if 0
static int new_codec_header(void *opaque, int ctx_index, uint8_t *mem_start)
{
int size = 0;
// new_codec_add_ioparam_queue(s, (void *)ioparam);
// qemu_cond_signal(&s->wrk_thread.cond);
}
+#endif
static void new_codec_wakeup_thread(NewCodecState *s, int api_index)
{
memcpy(mem_buf + size, &frame_size_ptr, sizeof(frame_size_ptr));
}
+#if 0
static void copyback_encode_video_data(int len, uint8_t *mem_buf)
{
memcpy(mem_buf, &len, sizeof(len));
{
memcpy(mem_buf, &len, sizeof(len));
}
+#endif
static AVCodec *new_codec_find_avcodec(uint8_t *mem_buf)
{
} else {
// uint32_t aaa = ((ctx_id - 1) * NEW_CODEC_META_DATA_SIZE);
- INFO("type: %d ctx: %d, meta_buf: 0x%x, size: %d\n",
- codec->type, ctx_id, ((ctx_id - 1) * NEW_CODEC_META_DATA_SIZE), size);
+ TRACE("ctx: %d, meta_buf: 0x%x, size: %d\n",
+ ctx_id, ((ctx_id - 1) * NEW_CODEC_META_DATA_SIZE), size);
copyback_init_data(avctx, meta_buf + size);
#if 0
copyback_decode_audio_data(avctx->channel_layout, len, frame_size_ptr, meta_buf);
elem = g_malloc0(sizeof(DeviceMemEntry));
- if (len >= 0) {
+ if (len > 0) {
tempbuf = g_malloc0(frame_size_ptr);
if (!tempbuf) {
ERR("decode_audio. failed to allocate memory, len %d, have_data: %d\n", len, frame_size_ptr);
}
}
- copyback_encode_audio_data(len, meta_buf);
+// copyback_encode_audio_data(len, meta_buf);
+ memcpy(meta_buf, &len, sizeof(len));
elem = g_malloc0(sizeof(DeviceMemEntry));
if (len > 0) {
return parser;
}
+#if 0
static int new_codec_parser_parse(AVCodecParserContext *pctx, AVCodecContext *avctx,
uint8_t *inbuf, int inbuf_size,
int64_t pts, int64_t dts, int64_t pos)
return ret;
}
+#endif
static void *new_codec_pop_readqueue(NewCodecState *s, int32_t file_index)
{
/*
* Codec Device APIs
*/
-static uint64_t new_codec_read(void *opaque, target_phys_addr_t addr, unsigned size)
+static uint64_t new_codec_read(void *opaque, hwaddr addr, unsigned size)
{
NewCodecState *s = (NewCodecState *)opaque;
uint64_t ret = 0;
return ret;
}
-static void new_codec_write(void *opaque, target_phys_addr_t addr,
+static void new_codec_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
NewCodecState *s = (NewCodecState *)opaque;
qemu_irq_raise(s->dev.irq[0]);
} else {
qemu_mutex_unlock(&s->context_queue_mutex);
- ERR("codec_wq is empty!!\n");
+ TRACE("codec_wq is empty!!\n");
}
TRACE("leave: %s\n", __func__);