changed each element name and source clean-up.
authorKitae Kim <kt920.kim@samsung.com>
Fri, 21 Jun 2013 13:07:32 +0000 (22:07 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Fri, 21 Jun 2013 13:10:04 +0000 (22:10 +0900)
Change-Id: I3ab90aa30a99e80e373cdac96a01a3ea2cfa3e3c
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
packaging/gst-plugins-emulator.spec
src/Makefile.am
src/gstemul.c
src/gstemulapi.c
src/gstemuldec.c [moved from src/gstemulnewdec.c with 98% similarity]
src/gstemulenc.c [moved from src/gstemulnewenc.c with 97% similarity]

index 89e6023..ae50422 100644 (file)
@@ -1,5 +1,5 @@
 Name: gst-plugins-emulator
-Version: 0.1.0
+Version: 0.1.1
 Release: 2 
 Summary: GStreamer Streaming-media framework plug-in for Tizen emulator.
 Group: TO_BE/FILLED_IN
index f17c3b4..dba449e 100644 (file)
@@ -16,8 +16,8 @@ plugin_LTLIBRARIES = libgstemul.la
 # sources used to compile this plug-in
 libgstemul_la_SOURCES = gstemul.c \
        gstemulutils.c \
-       gstemulnewdec.c \
-       gstemulnewenc.c \
+       gstemuldec.c \
+       gstemulenc.c \
        gstemulapi.c \
        gstemuldev.c \
        gstemulapi2.c
index d4482af..97e93e6 100644 (file)
@@ -62,9 +62,10 @@ gst_emul_codec_element_init ()
   int version = 0;
   int data_length = 0;
   int ret = TRUE;
+  int i, elem_cnt = 0;
   void *buffer = NULL;
-  GList *element = NULL;
-  CodecIOParams params;
+//  GList *element = NULL;
+  CodecElement *elem = NULL;
 
   fd = open (CODEC_DEV, O_RDWR);
   if (fd < 0) {
@@ -83,76 +84,31 @@ gst_emul_codec_element_init ()
     perror ("failure memory mapping.");
   }
 
-#if 0
-  memset(&params, 0, sizeof(params));
-  params.api_index = CODEC_ELEMENT_INIT;
-  if (write (fd, &params, 1) < 0) {
-    perror ("failed to copy data to qemu");
-  }
-#endif
-
-  CODEC_LOG (DEBUG, "request a device to get codec element.\n");
+//  CODEC_LOG (DEBUG, "request a device to get codec element.\n");
   ioctl(fd, CODEC_CMD_GET_ELEMENT, NULL);
 
-  // TODO: source clean-up.
-#if 0
-  do {
-    CodecElement *elm = NULL;
-
-    elm = g_malloc0 (sizeof(CodecElement));
-    if (!elm) {
-      CODEC_LOG (ERR, "Failed to allocate memory.\n");
-      ret = FALSE;
-      break;
-    }
-
-//    memcpy (&data_length, (uint8_t *)buffer + size, sizeof(data_length));
-    data_length = *(int*)(((uint8_t *)buffer + size));
-
-    printf("[%s][%d] data_length = %d\n", __func__, __LINE__, data_length);
-
-    size += sizeof(data_length);
-    if (data_length == 0) {
-      break;
-    }
-    memcpy (elm, (uint8_t *)buffer + size, data_length);
-    size += data_length;
-#if 0
-    printf("[%p] codec: %s, %s, %s %s\n", elm,
-        elm->name, elm->longname,
-        elm->media_type ? "Audio" : "Video",
-        elm->codec_type ? "Encoder" : "Decoder");
-#endif
-    element = g_list_append (element, elm);
-  } while (1);
-#endif
+  memcpy(&data_length, (uint8_t *)buffer, sizeof(data_length));
+  size += sizeof(data_length);
 
-  CodecElement *elem = NULL;
-  {
-    memcpy(&data_length, (uint8_t *)buffer, sizeof(data_length));
-    size += sizeof(data_length);
-    printf("[%s][%d] data_length = %d\n", __func__, __LINE__, data_length);
-
-    elem = g_malloc0 (data_length);
-    if (!elem) {
-      CODEC_LOG (ERR, "Failed to allocate memory.\n");
-      ret = FALSE;
-      munmap (buffer, 4096);
-      close (fd);
-      return ret;
-    }
-
-    memcpy (elem, (uint8_t *)buffer + size, data_length);
+//  printf("[gst-emul][%d] data_length = %d\n", __LINE__, data_length);
+
+  elem = g_malloc0 (data_length);
+  if (!elem) {
+    CODEC_LOG (ERR, "Failed to allocate memory.\n");
+    ret = FALSE;
+    munmap (buffer, 4096);
+    close (fd);
+    return ret;
   }
 
-  {
-    int i;
-    int elem_cnt = data_length / sizeof(CodecElement);
-    for (i = 0; i < elem_cnt; i++) {
-      element = g_list_append (element, &elem[i]);
-    }
+  memcpy (elem, (uint8_t *)buffer + size, data_length);
+
+  elem_cnt = data_length / sizeof(CodecElement);
+  for (i = 0; i < elem_cnt; i++) {
+//  element = g_list_append (element, &elem[i]);
+    codec_element = g_list_append (codec_element, &elem[i]);
   }
-  codec_element = element;
+//  codec_element = element;
 
   munmap (buffer, 4096);
   close (fd);
@@ -182,9 +138,11 @@ plugin_init (GstPlugin *plugin)
     return FALSE;
   }
 
+#if 0
   while ((codec_element = g_list_next (codec_element))) {
     g_list_free (codec_element);
   }
+#endif
 
   return TRUE;
 }
index 3405a6a..4ec8d48 100644 (file)
@@ -37,7 +37,6 @@ void emul_codec_write_to_qemu (int ctx_index, int api_index, CodecDevice *dev)
 {
   CodecIOParams ioparam;
 
-//  memset(&ioparam, 0, sizeof(ioparam));
   ioparam.api_index = api_index;
   ioparam.ctx_index = ctx_index;
   ioparam.mem_offset = dev->mem_info.offset;
@@ -66,8 +65,8 @@ static struct mem_info secure_device_mem()
   info.start = (gpointer)((uint32_t)device_mem + mem_offset);
   info.offset = mem_offset;
 
-  CODEC_LOG (DEBUG, "leave: %s\n", __func__);
   CODEC_LOG (DEBUG, "caramis0 = 0x%x\n", mem_offset);
+  CODEC_LOG (DEBUG, "leave: %s\n", __func__);
 
   return info;
 }
@@ -140,7 +139,7 @@ emul_avcodec_init (CodecContext *ctx, CodecElement *codec, CodecDevice *dev)
   }
 
   ioctl(fd, CODEC_CMD_GET_CONTEXT_INDEX, &ctx->index);
-  CODEC_LOG (DEBUG, "recv context index: %d\n", ctx->index);
+  CODEC_LOG (DEBUG, "get context index: %d\n", ctx->index);
 
   ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &mem_offset);
   emul_avcodec_init_to (ctx, codec, mmapbuf + mem_offset);
@@ -190,7 +189,6 @@ emul_avcodec_decode_video (CodecContext *ctx, uint8_t *in_buf, int in_size,
   int fd;
   uint8_t *mmapbuf = NULL;
   int len = 0;
-//  int copyback, usable;
   uint32_t mem_offset = 0;
 
   CODEC_LOG (DEBUG, "enter: %s\n", __func__);
@@ -247,41 +245,13 @@ emul_av_picture_copy (CodecContext *ctx, uint8_t *pict,
     return;
   }
 
-#if 0
-  ioctl (fd, CODEC_CMD_ADD_TASK_QUEUE, NULL);
-
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[copy_frame] waiting before write.\n");
-      usleep (500);
-      continue;
-    }
-    break;
-  }
-
-  emul_codec_write_to_qemu (ctx->index, CODEC_PICTURE_COPY, dev);
-
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[copy_frame] waiting after write.\n");
-      usleep (500);
-      continue;
-    }
-    memcpy (pict, mmapbuf, pict_size);
-    break;
-  }
-  ioctl (fd, CODEC_CMD_REMOVE_TASK_QUEUE, &copyback);
-#endif
-
   dev->mem_info.offset = (uint32_t)pict - (uint32_t)device_mem;
   CODEC_LOG (DEBUG, "[%s] mem_offset = 0x%x\n", __func__, dev->mem_info.offset);
   emul_codec_write_to_qemu (ctx->index, CODEC_PICTURE_COPY, dev);
 //  ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &mem_offset);
   ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM2, &(dev->mem_info.offset));
 
-  CODEC_LOG (DEBUG, "caramis1 = 0x%x\n", __func__, mem_offset);
+  CODEC_LOG (DEBUG, "[%s] caramis1 = 0x%x\n", __func__, mem_offset);
 #if 0
   memcpy (pict, mmapbuf, pict_size);
 
@@ -316,38 +286,6 @@ emul_avcodec_decode_audio (CodecContext *ctx, int16_t *samples,
     return -1;
   }
 
-#if 0
-  ioctl (fd, CODEC_CMD_ADD_TASK_QUEUE, NULL);
-
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[decode_audio] waiting before write.\n");
-      usleep (500);
-      continue;
-    }
-
-    emul_avcodec_decode_audio_to (in_buf, in_size, mmapbuf);
-    break;
-  }
-
-  emul_codec_write_to_qemu (ctx->index, CODEC_DECODE_AUDIO, dev);
-
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[decode_audio] waiting after write.\n");
-      usleep (500);
-      continue;
-    }
-
-    len =
-      emul_avcodec_decode_audio_from (ctx, frame_size_ptr, samples, mmapbuf);
-    break;
-  }
-  ioctl (fd, CODEC_CMD_REMOVE_TASK_QUEUE, &copyback);
-#endif
-
   ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &mem_offset);
   emul_avcodec_decode_audio_to (in_buf, in_size, mmapbuf + mem_offset);
 
@@ -373,7 +311,7 @@ emul_avcodec_encode_video (CodecContext *ctx, uint8_t *out_buf,
   int fd;
   void *mmapbuf;
   int len = 0;
-  int copyback, usable;
+  uint32_t mem_offset = 0;
 
   CODEC_LOG (DEBUG, "enter: %s\n", __func__);
 
@@ -389,35 +327,18 @@ emul_avcodec_encode_video (CodecContext *ctx, uint8_t *out_buf,
     return -1;
   }
 
-//  ioctl (fd, CODEC_CMD_ADD_TASK_QUEUE, NULL);
-#if 0
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[encode_video] waiting before write.\n");
-      usleep (500);
-      continue;
-    }
-
-    emul_avcodec_encode_video_to (in_buf, in_size, in_timestamp, mmapbuf);
-    break;
-  }
+  ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &mem_offset);
+  CODEC_LOG (DEBUG, "[%s] mem_offset = 0x%x\n", __func__, mem_offset);
+  emul_avcodec_encode_video_to (in_buf, in_size, in_timestamp, mmapbuf);
 
+  dev->mem_info.offset = mem_offset;
   emul_codec_write_to_qemu (ctx->index, CODEC_ENCODE_VIDEO, dev);
 
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[encode_video] waiting after write.\n");
-      usleep (500);
-      continue;
-    }
+  ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &mem_offset);
+  CODEC_LOG (DEBUG, "[%s] mem_offset = 0x%x\n", __func__, mem_offset);
+  len = emul_avcodec_encode_video_from (out_buf, out_size, mmapbuf);
 
-    len = emul_avcodec_encode_video_from (out_buf, out_size, mmapbuf);
-    break;
-  }
-  ioctl (fd, CODEC_CMD_REMOVE_TASK_QUEUE, &copyback);
-#endif
+  ioctl (fd, CODEC_CMD_REMOVE_TASK_QUEUE, &mem_offset);
 
   CODEC_LOG (DEBUG, "leave: %s\n", __func__);
   return len;
@@ -429,9 +350,9 @@ emul_avcodec_encode_audio (CodecContext *ctx, uint8_t *out_buf,
                           int in_size, CodecDevice *dev)
 {
   int fd;
-  void *mmapbuf;
+  void *mmapbuf = NULL;
   int len = 0;
-  int copyback, usable;
+  uint32_t mem_offset = 0;
 
   CODEC_LOG (DEBUG, "enter: %s\n", __func__);
 
@@ -447,34 +368,18 @@ emul_avcodec_encode_audio (CodecContext *ctx, uint8_t *out_buf,
     return -1;
   }
 
-//  ioctl (fd, CODEC_CMD_ADD_TASK_QUEUE, NULL);
-#if 0
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[encode_audio] waiting before write.\n");
-      usleep (500);
-      continue;
-    }
-
-    emul_avcodec_encode_audio_to (out_size, in_size, in_buf, mmapbuf);
-    break;
-  }
+  ioctl (fd, CODEC_CMD_COPY_TO_DEVICE_MEM, &mem_offset);
+  CODEC_LOG (DEBUG, "[%s] mem_offset = 0x%x\n", __func__, mem_offset);
+  emul_avcodec_encode_audio_to (out_size, in_size, in_buf, mmapbuf);
 
+  dev->mem_info.offset = mem_offset;
   emul_codec_write_to_qemu (ctx->index, CODEC_ENCODE_AUDIO, dev);
 
-  while (1) {
-    ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &usable);
-    if (usable) {
-      CODEC_LOG (DEBUG, "[encode_audio] waiting after write.\n");
-      usleep (500);
-      continue;
-    }
-    len = emul_avcodec_encode_audio_from (out_buf, out_size, mmapbuf);
-    break;
-  }
-  ioctl (fd, CODEC_CMD_REMOVE_TASK_QUEUE, &copyback);
-#endif
+  ioctl (fd, CODEC_CMD_COPY_FROM_DEVICE_MEM, &mem_offset);
+  CODEC_LOG (DEBUG, "[%s] mem_offset = 0x%x\n", __func__, mem_offset);
+  len = emul_avcodec_encode_audio_from (out_buf, out_size, mmapbuf);
+
+  ioctl (fd, CODEC_CMD_REMOVE_TASK_QUEUE, &mem_offset);
 
   CODEC_LOG (DEBUG, "leave: %s\n", __func__);
   return len;
similarity index 98%
rename from src/gstemulnewdec.c
rename to src/gstemuldec.c
index 92ff1a2..f390bff 100644 (file)
@@ -33,7 +33,7 @@
 #include "gstemulapi.h"
 #include "gstemuldev.h"
 
-#define GST_EMULDEC_PARAMS_QDATA g_quark_from_static_string("emuldec-params")
+#define GST_EMULDEC_PARAMS_QDATA g_quark_from_static_string("marudec-params")
 
 /* indicate dts, pts, offset in the stream */
 typedef struct
@@ -332,7 +332,7 @@ gst_emuldec_base_init (GstEmulDecClass *klass)
   GstCaps *sinkcaps, *srccaps;
   GstPadTemplate *sinktempl, *srctempl;
   CodecElement *codec;
-  gchar *longname, *classification;
+  gchar *longname, *classification, *description;
 
   codec =
       (CodecElement *)g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass),
@@ -342,15 +342,17 @@ gst_emuldec_base_init (GstEmulDecClass *klass)
   classification = g_strdup_printf ("Codec/Decoder/%s",
                     (codec->media_type == AVMEDIA_TYPE_VIDEO) ?
                     "Video" : "Audio");
+  description = g_strdup_printf("%s Decoder", codec->name);
 
   gst_element_class_set_details_simple (element_class,
-            longname,                                     // longname
-            classification,                               // classification
-            "accelerated codec for Tizen Emulator",       // description
-            "Kitae Kim <kt920.kim@samsung.com>");         // author
+            longname,
+            classification,
+            description,
+            "Kitae Kim <kt920.kim@samsung.com>");
 
   g_free (longname);
   g_free (classification);
+  g_free (description);
 
   sinkcaps = gst_emul_codecname_to_caps (codec->name, NULL, FALSE);
   if (!sinkcaps) {
@@ -749,7 +751,7 @@ gst_emuldec_open (GstEmulDec *emuldec)
                             oclass->codec, emuldec->dev) < 0) {
     gst_emuldec_close (emuldec);
     GST_DEBUG_OBJECT (emuldec,
-      "tzdec_%s: Failed to open codec", oclass->codec->name);
+      "maru_%sdec: Failed to open codec", oclass->codec->name);
   }
 
   emuldec->opened = TRUE;
@@ -1340,7 +1342,7 @@ gst_emuldec_frame (GstEmulDec *emuldec, guint8 *data, guint size,
 
   if (len < 0 || have_data < 0) {
     GST_WARNING_OBJECT (emuldec,
-        "tzdec_%s: decoding error (len: %d, have_data: %d)",
+        "maru_%sdec: decoding error (len: %d, have_data: %d)",
         oclass->codec->name, len, have_data);
     *got_data = 0;
     return len;
@@ -1405,7 +1407,7 @@ gst_emuldec_chain (GstPad *pad, GstBuffer *buffer)
     // not_negotiated
     oclass = (GstEmulDecClass *) (G_OBJECT_GET_CLASS (emuldec));
     GST_ELEMENT_ERROR (emuldec, CORE, NEGOTIATION, (NULL),
-      ("tzdec_%s: input format was not set before data start",
+      ("maru_%sdec: input format was not set before data start",
         oclass->codec->name));
     gst_buffer_unref (buffer);
     return GST_FLOW_NOT_NEGOTIATED;
@@ -1543,8 +1545,7 @@ gst_emuldec_register (GstPlugin *plugin, GList *element)
 
   GType type;
   gchar *type_name;
-  gint rank = GST_RANK_PRIMARY;
-  gboolean ret = TRUE;
+  gint rank = GST_RANK_NONE;
   GList *elem = element;
   CodecElement *codec = NULL;
 
@@ -1553,15 +1554,14 @@ gst_emuldec_register (GstPlugin *plugin, GList *element)
   do {
     codec = (CodecElement *)elem->data;
     if (!codec) {
-      ret = FALSE;
-      break;
+      return FALSE;
     }
 
     if (codec->codec_type != CODEC_TYPE_DECODE) {
       continue;
     }
 
-    type_name = g_strdup_printf ("tzdec_%s", codec->name);
+    type_name = g_strdup_printf ("maru_%sdec", codec->name);
     type = g_type_from_name (type_name);
     if (!type) {
       type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);
@@ -1575,5 +1575,5 @@ gst_emuldec_register (GstPlugin *plugin, GList *element)
     g_free (type_name);
   } while ((elem = g_list_next (elem)));
 
-  return ret;
+  return TRUE;
 }
similarity index 97%
rename from src/gstemulnewenc.c
rename to src/gstemulenc.c
index 61c1529..41ccfaa 100644 (file)
@@ -33,7 +33,7 @@
 #include "gstemuldev.h"
 #include <gst/base/gstadapter.h>
 
-#define GST_EMULENC_PARAMS_QDATA g_quark_from_static_string("emulenc-params")
+#define GST_EMULENC_PARAMS_QDATA g_quark_from_static_string("maruenc-params")
 
 typedef struct _GstEmulEnc
 {
@@ -110,7 +110,7 @@ gst_emulenc_base_init (GstEmulEncClass *klass)
     GstPadTemplate *sinktempl = NULL, *srctempl = NULL;
     GstCaps *sinkcaps = NULL, *srccaps = NULL;
     CodecElement *codec;
-    gchar *longname, *classification;
+    gchar *longname, *classification, *description;
 
     codec =
         (CodecElement *)g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass),
@@ -119,11 +119,13 @@ gst_emulenc_base_init (GstEmulEncClass *klass)
     longname = g_strdup_printf ("%s Encoder", codec->longname);
     classification = g_strdup_printf ("Codec/Encoder/%s",
             (codec->media_type == AVMEDIA_TYPE_VIDEO) ? "Video" : "Audio");
+    description = g_strdup_printf ("%s Encoder", codec->name);
 
     gst_element_class_set_details_simple (element_class,
             longname,
             classification,
-            "accelerated codec for Tizen Emulator",
+            description,
+//            "accelerated codec for Tizen Emulator",
             "Kitae Kim <kt920.kim@samsung.com>");
 
     g_free (longname);
@@ -551,7 +553,7 @@ gst_emulenc_setcaps (GstPad *pad, GstCaps *caps)
   // open codec
   if (gst_emul_avcodec_open (emulenc->context,
       oclass->codec, emulenc->dev) < 0) {
-    GST_DEBUG_OBJECT (emulenc, "tzenc_%s: Failed to open codec",
+    GST_DEBUG_OBJECT (emulenc, "maru_%senc: Failed to open codec",
         oclass->codec->name);
     return FALSE;
   }
@@ -559,14 +561,14 @@ gst_emulenc_setcaps (GstPad *pad, GstCaps *caps)
   if (pix_fmt != emulenc->context->video.pix_fmt) {
     gst_emul_avcodec_close (emulenc->context, emulenc->dev);
     GST_DEBUG_OBJECT (emulenc,
-      "tzenc_%s: AV wants different colorspace (%d given, %d wanted)",
+      "maru_%senc: AV wants different colorspace (%d given, %d wanted)",
       oclass->codec->name, pix_fmt, emulenc->context->video.pix_fmt);
     return FALSE;
   }
 
   if (oclass->codec->media_type == AVMEDIA_TYPE_VIDEO
     && pix_fmt == PIX_FMT_NONE) {
-    GST_DEBUG_OBJECT (emulenc, "tzenc_%s: Failed to determine input format",
+    GST_DEBUG_OBJECT (emulenc, "maru_%senc: Failed to determine input format",
       oclass->codec->name);
     return FALSE;
   }
@@ -684,7 +686,7 @@ gst_emulenc_chain_video (GstPad *pad, GstBuffer *buffer)
     GstEmulEncClass *oclass =
       (GstEmulEncClass *) (G_OBJECT_GET_CLASS (emulenc));
     GST_ERROR_OBJECT (emulenc,
-        "tzenc_%s: failed to encode buffer", oclass->codec->name);
+        "maru_%senc: failed to encode buffer", oclass->codec->name);
     gst_buffer_unref (buffer);
     return GST_FLOW_OK;
   }
@@ -951,7 +953,7 @@ gst_emulenc_flush_buffers (GstEmulEnc *emulenc, gboolean send)
       GstEmulEncClass *oclass =
         (GstEmulEncClass *) (G_OBJECT_GET_CLASS (emulenc));
       GST_WARNING_OBJECT (emulenc,
-        "tzenc_%s: failed to flush buffer", oclass->codec->name);
+        "maru_%senc: failed to flush buffer", oclass->codec->name);
       break;
     }
 
@@ -1111,7 +1113,7 @@ gst_emulenc_register (GstPlugin *plugin, GList *element)
 
   GType type;
   gchar *type_name;
-  gint rank = GST_RANK_PRIMARY;
+  gint rank = GST_RANK_NONE;
   gboolean ret = TRUE;
   GList *elem = element;
   CodecElement *codec = NULL;
@@ -1129,7 +1131,7 @@ gst_emulenc_register (GstPlugin *plugin, GList *element)
       continue;
     }
 
-    type_name = g_strdup_printf ("tzenc_%s", codec->name);
+    type_name = g_strdup_printf ("maru_%senc", codec->name);
     type = g_type_from_name (type_name);
     if (!type) {
       type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0);