felipec gst-openmax: gst-openmax/omx/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-openmax
Changes by:     felipec
Date:           Thu Nov 20 2008  17:13:56 UTC

Log message:
Rename avcenc to h264enc.
No need to follow OpenMAX IL's AVC nomenclature.

Modified files:
    omx             : Makefile.am gstomx.c gstomx_h264dec.c
Added files:
    omx             : gstomx_h264enc.c gstomx_h264enc.h
Removed files:
    omx             : gstomx_avcenc.c gstomx_avcenc.h

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/Makefile.am.diff?r1=1.31&r2=1.32
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx.c.diff?r1=1.38&r2=1.39
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_avcenc.c
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_avcenc.h
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_h264dec.c.diff?r1=1.10&r2=1.11
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_h264enc.c?rev=1.1&content-type=text/vnd.viewcvs-markup
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_h264enc.h?rev=1.1&content-type=text/vnd.viewcvs-markup

====Begin Diffs====
Index: Makefile.am
===================================================================
RCS file: /cvs/gstreamer/gst-openmax/omx/Makefile.am,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- Makefile.am	20 Nov 2008 16:16:54 -0000	1.31
+++ Makefile.am	20 Nov 2008 17:13:41 -0000	1.32
@@ -13,7 +13,7 @@
 		       gstomx_h264dec.c gstomx_h264dec.h \
 		       gstomx_wmvdec.c gstomx_wmvdec.h \
 		       gstomx_mpeg4enc.c gstomx_mpeg4enc.h \
-		       gstomx_avcenc.c gstomx_avcenc.h \
+		       gstomx_h264enc.c gstomx_h264enc.h \
 		       gstomx_h263enc.c gstomx_h263enc.h \
 		       gstomx_vorbisdec.c gstomx_vorbisdec.h \
 		       gstomx_amrnbdec.c gstomx_amrnbdec.h \
Index: gstomx.c
RCS file: /cvs/gstreamer/gst-openmax/omx/gstomx.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- gstomx.c	20 Nov 2008 17:02:52 -0000	1.38
+++ gstomx.c	20 Nov 2008 17:13:41 -0000	1.39
@@ -26,7 +26,7 @@
 #include "gstomx_h264dec.h"
 #include "gstomx_wmvdec.h"
 #include "gstomx_mpeg4enc.h"
-#include "gstomx_avcenc.h"
+#include "gstomx_h264enc.h"
 #include "gstomx_h263enc.h"
 #include "gstomx_vorbisdec.h"
 #include "gstomx_mp3dec.h"
@@ -97,7 +97,7 @@
         return false;
     }
 
-    if (!gst_element_register (plugin, "omx_avcenc", DEFAULT_RANK, GST_OMX_AVCENC_TYPE))
+    if (!gst_element_register (plugin, "omx_h264enc", DEFAULT_RANK, GST_OMX_H264ENC_TYPE))
     {
--- gstomx_avcenc.c DELETED ---
--- gstomx_avcenc.h DELETED ---
Index: gstomx_h264dec.c
RCS file: /cvs/gstreamer/gst-openmax/omx/gstomx_h264dec.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- gstomx_h264dec.c	15 Aug 2008 14:49:20 -0000	1.10
+++ gstomx_h264dec.c	20 Nov 2008 17:13:42 -0000	1.11
@@ -55,9 +55,9 @@
         GstElementDetails details;
-        details.longname = "OpenMAX IL H.264 video decoder";
+        details.longname = "OpenMAX IL H.264/AVC video decoder";
         details.klass = "Codec/Decoder/Video";
-        details.description = "Decodes video in H.264 format with OpenMAX IL";
+        details.description = "Decodes video in H.264/AVC format with OpenMAX IL";
         details.author = "Felipe Contreras";
         gst_element_class_set_details (element_class, &details);
--- NEW FILE: gstomx_h264enc.c ---
/*
 * Copyright (C) 2007-2008 Nokia Corporation.
 *
 * Author: Felipe Contreras <[email protected]>
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation
 * version 2.1 of the License.
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "gstomx_h264enc.h"
#include "gstomx.h"
#include <stdlib.h> /* For calloc, free */
#define OMX_COMPONENT_NAME "OMX.st.video_encoder.avc"
static GstOmxBaseFilterClass *parent_class = NULL;
static GstCaps *
generate_src_template (void)
{
    GstCaps *caps;
    caps = gst_caps_new_simple ("video/x-h264",
                                "width", GST_TYPE_INT_RANGE, 16, 4096,
                                "height", GST_TYPE_INT_RANGE, 16, 4096,
                                "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 30, 1,
                                NULL);
    return caps;
}
static void
type_base_init (gpointer g_class)
    GstElementClass *element_class;
    GstOmxBaseFilterClass *omx_base_class;
    omx_base_class = GST_OMX_BASE_FILTER_CLASS (g_class);
    element_class = GST_ELEMENT_CLASS (g_class);
    {
        GstElementDetails details;
        details.longname = "OpenMAX IL H.264/AVC video encoder";
        details.klass = "Codec/Encoder/Video";
        details.description = "Encodes video in H.264/AVC format with OpenMAX IL";
        details.author = "Felipe Contreras";
        gst_element_class_set_details (element_class, &details);
    }
        GstPadTemplate *template;
        template = gst_pad_template_new ("src", GST_PAD_SRC,
                                         GST_PAD_ALWAYS,
                                         generate_src_template ());
        gst_element_class_add_pad_template (element_class, template);
type_class_init (gpointer g_class,
                 gpointer class_data)
    parent_class = g_type_class_ref (GST_OMX_BASE_FILTER_TYPE);
settings_changed_cb (GOmxCore *core)
    GstOmxBaseFilter *omx_base;
    guint width;
    guint height;
    guint framerate;
    omx_base = core->client_data;
    GST_DEBUG_OBJECT (omx_base, "settings changed");
        OMX_PARAM_PORTDEFINITIONTYPE *param;
        param = calloc (1, sizeof (OMX_PARAM_PORTDEFINITIONTYPE));
        param->nSize = sizeof (OMX_PARAM_PORTDEFINITIONTYPE);
        param->nVersion.s.nVersionMajor = 1;
        param->nVersion.s.nVersionMinor = 1;
        param->nPortIndex = 1;
        OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamPortDefinition, param);
        width = param->format.video.nFrameWidth;
        height = param->format.video.nFrameHeight;
        framerate = param->format.video.xFramerate;
        free (param);
        GstCaps *new_caps;
        new_caps = gst_caps_new_simple ("video/x-h264",
                                        "width", G_TYPE_INT, width,
                                        "height", G_TYPE_INT, height,
                                        "framerate", GST_TYPE_FRACTION, framerate, 1,
                                        NULL);
        GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
        gst_pad_set_caps (omx_base->srcpad, new_caps);
type_instance_init (GTypeInstance *instance,
                    gpointer g_class)
    GstOmxBaseFilter *omx_base_filter;
    GstOmxBaseVideoEnc *omx_base;
    omx_base_filter = GST_OMX_BASE_FILTER (instance);
    omx_base = GST_OMX_BASE_VIDEOENC (instance);
    omx_base_filter->omx_component = g_strdup (OMX_COMPONENT_NAME);
    omx_base->compression_format = OMX_VIDEO_CodingAVC;
    omx_base_filter->gomx->settings_changed_cb = settings_changed_cb;
GType
gst_omx_h264enc_get_type (void)
    static GType type = 0;
    if (G_UNLIKELY (type == 0))
        GTypeInfo *type_info;
        type_info = g_new0 (GTypeInfo, 1);
        type_info->class_size = sizeof (GstOmxH264EncClass);
        type_info->base_init = type_base_init;
        type_info->class_init = type_class_init;
        type_info->instance_size = sizeof (GstOmxH264Enc);
        type_info->instance_init = type_instance_init;
        type = g_type_register_static (GST_OMX_BASE_VIDEOENC_TYPE, "GstOmxH264Enc", type_info, 0);
        g_free (type_info);
    return type;
--- NEW FILE: gstomx_h264enc.h ---
#ifndef GSTOMX_H264ENC_H
#define GSTOMX_H264ENC_H
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_OMX_H264ENC(obj) (GstOmxH264Enc *) (obj)
#define GST_OMX_H264ENC_TYPE (gst_omx_h264enc_get_type ())
typedef struct GstOmxH264Enc GstOmxH264Enc;
typedef struct GstOmxH264EncClass GstOmxH264EncClass;
#include "gstomx_base_videoenc.h"
struct GstOmxH264Enc
    GstOmxBaseVideoEnc omx_base;
};
struct GstOmxH264EncClass
    GstOmxBaseVideoEncClass parent_class;
GType gst_omx_h264enc_get_type (void);
G_END_DECLS
#endif /* GSTOMX_H264ENC_H */

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.