Skip to content

Commit

Permalink
Adding support for decoder (60fps by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
bperez committed Nov 28, 2011
1 parent f98c522 commit f169978
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README
Expand Up @@ -112,9 +112,11 @@ Contents
- Modifying build system, new build system is based in the use of a shared
library called libOmx.

- Adding support for omx_camera
- Adding support for omx_camera.

- Adding support for omx_tvp
- Adding support for omx_tvp.

- Adding support for decoder, 60fps by default.


8. If something goes wrong
Expand Down
16 changes: 11 additions & 5 deletions omx/gstomx_base_videodec.c
Expand Up @@ -155,13 +155,19 @@ sink_setcaps (GstPad *pad,
{
self->framerate_num = gst_value_get_fraction_numerator (framerate);
self->framerate_denom = gst_value_get_fraction_denominator (framerate);
}
else
{
self->framerate_num = 60;
self->framerate_denom = 1;

omx_base->duration = gst_util_uint64_scale_int(GST_SECOND,
gst_value_get_fraction_denominator (framerate),
gst_value_get_fraction_numerator (framerate));
GST_DEBUG_OBJECT (self, "Nominal frame duration =%"GST_TIME_FORMAT,
GST_TIME_ARGS (omx_base->duration));
}
omx_base->duration = gst_util_uint64_scale_int(GST_SECOND,
self->framerate_denom,
self->framerate_num);
GST_DEBUG_OBJECT (self, "Nominal frame duration =%"GST_TIME_FORMAT,
GST_TIME_ARGS (omx_base->duration));

}
/* check for pixel-aspect-ratio, to set to src caps */
{
Expand Down
11 changes: 6 additions & 5 deletions omx/gstomx_h264dec.c
@@ -1,6 +1,9 @@
/*
* Copyright (C) 2007-2009 Nokia Corporation.
*
* Modified by: David Soto <david.soto@ridgerun.com>
* Copyright (C) 2011 RidgeRun
* Author: Felipe Contreras <felipe.contreras@nokia.com>
*
* This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -104,19 +107,17 @@ initialize_port (GstOmxBaseFilter *omx_base)
paramPort.format.video.nFrameHeight = height;
paramPort.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
paramPort.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
paramPort.format.video.xFramerate = (60) << 16;

GST_DEBUG_OBJECT (self, "nFrameWidth = %ld, nFrameHeight = %ld, nBufferCountActual = %ld",
paramPort.format.video.nFrameWidth, paramPort.format.video.nFrameHeight,
paramPort.nBufferCountActual);

if(self->framerate_denom)
paramPort.format.video.xFramerate = (self->framerate_num/self->framerate_denom) << 16;

GST_DEBUG_OBJECT (self, "G_OMX_PORT_SET_DEFINITION (output)");
G_OMX_PORT_SET_DEFINITION (omx_base->out_port, &paramPort);

G_OMX_PORT_GET_DEFINITION (omx_base->in_port, &paramPort);
//paramPort.nBufferCountActual = 8;
paramPort.format.video.xFramerate = (60) << 16;
G_OMX_PORT_SET_DEFINITION (omx_base->in_port, &paramPort);
#if 0
port = g_omx_core_get_port (gomx, "input", 0);

Expand Down

0 comments on commit f169978

Please sign in to comment.