This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI8168: OMX capture of bt.656 embedded sync problems

Other Parts Discussed in Thread: TVP5151, TVP5158

Hello,

We're using a custom input board to drive the Video Input Ports of the DM8168.  With the RidgeRun omx_camera extensions for gstreamer, we can stream 1080p30 video from an HDMI source on Video Input Port 1 using 16-bit capture mode.  Of course, we can also record using the TI capture_encode demo.

We're having problems, however, capturing NTSC bt.656 embedded-sync video on Video Input Port 2(A) with 8-bit mode.  The NTSC decoder is the TVP5151, similar to the ever-popular 5150 and we're confident we have the chip configured for bt.656 embedded sync and we're confident we're clocking at 27 Mhz.  When I switch the omx_camera or capture_encode demo to 8 bit mode and VIP2_PORTA, it hangs... never receiving any frames.

Are there other OMX configuration widgets I need to play with?

Looking around, I've found similar issues but little guidance:

http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/157094.aspx : Shows some success with external syncs, but not embedded.  Our hardware design does not allow us to switch to external syncs, so I can't duplicate those results.

http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/154092.aspx : Provides some suggestions on ACTVID manipulation, but again appears to apply to external sync only.

http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/159862.aspx : Not sure it's relavant, but this indicates problems with 4:2:2 support at the VFCC layer.  I don't have source code, so cannot confirm or deny.

One additional note: From what little I know, bt.656 uses UYVY byte ordering, but VFCC can only be configured for OMX_COLOR_Format24bitRGB888 or OMX_COLOR_FormatYCbYCr (YUY2).  Could that be causing timing problems?  I would have expected video with wonky colorspacing rather than no video at all, but I'm already way past the edge of my useful knowledge, so can't say with certainty if this is a problem or not.

Thanks in advance for guidance or suggestions.

Dave

  • Dave,

    I have had similar question, I want to capture second video stream from the J2,J3,J4. Unfortunately, TI expert said, currently their OPENMAx haven't software to support it, we have to do our own program.

     

     

    George

  • Hey , 

    i'm trying to do the same , capture video with tvp5158 for ti8168 .

    it seems there's no support for this tvp .. :/

    help ?

  • Delayed follow-up for anyone who hits this on a random search:

    This issue appears to be resolved in 5.04.  We can now capture 8-bit wide inputs on either PORTA or PORTB (high 8 bits or low 8 bits of video input port).  We're still having de-interlace issues for the stream, but that's not related to the previously reported capture problems.

    Dave

  • Hi David ,

    I am trying to capture 8-bit bt.656 embedded sync using OMX App on DM8148 custom board using EZSDK 5.04 . We have got a Analog Devices video decoder providing video data in bt.656 format  embedded sync .

    I am trying to do capture on VIP1 PORTB ,I see that my OMX app hangs and VFCC is not able to capture frames . My OMX app has got only Capture component ,the app captures bt.656 data in YCbYcr format and stores into a file in YUV420sp format .

    I see that you are able to capture 8-bit bt.656 embedded sync on VIP1 PORTB ,Can you tell us how did you solve the problem ?

    Thanks.

    Siva .

  • Hi David,

    I am not able capture bt.656 data on VIP0 PORTB with the OMX app ,Can you please share what you have done in the OMX framework for bt.656 capture on VIP0 PORTB to work ? Was it a straight forward thing or some changes need to be done in the OMX framework ?

    Thanks,

    Siva .

  • /* GStreamer
     *
     * Copyright (C) 2011 RidgeRun
     * Copyright (C) 2009 Texas Instruments, Inc - http://www.ti.com/
     *
     * Description: OMX Camera element for DM81xx
     * David Soto  <david.soto@ridgerun.com>
     *
     * Based on gstomx_camera by Rob Clark <rob@ti.com>
     *
     * 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_camera.h"
    #include "gstomx.h"
    
    #include <OMX_TI_Common.h>
    #include <omx_vfcc.h>
    #include <omx_ctrl.h>
    #include <gst/video/video.h>
    
    #include <OMX_TI_IVCommon.h>
    #include <OMX_TI_Index.h>
    
    #include <stdint.h>
    #include <fcntl.h>
    #include <sys/ioctl.h>
    #include <OMX_CoreExt.h>
    #include <OMX_IndexExt.h>
    
    char* PORT_NAMES(int i)
    {
    	switch (i)
    	{
    		case 1: return "VIP1_PORTA";
    		case 2: return "VIP1_PORTB";
    		case 3: return "VIP2_PORTA";
    		case 4: return "VIP2_PORTB";
    		break;
    	}
    	return NULL;
    }
    
    char* MODE_NAMES(int i)
    {
    	switch (i)
    	{
    		case 1: return "SC_NON_MUX";
    		case 2: return "MC_LINE_MUX";
    		case 3: return "MC_PEL_MUX";
    		case 4: return "SC_DISCRETESYNC";
    		case 5: return "MC_LINE_MUX_SPLIT_LINE";
    		case 6: return "SC_DISCRETESYNC_ACTVID_VSYNC";
    		break;
    	}
    	return NULL;
    }
    
    char* VIF_NAMES(int i)
    {
    	switch (i)
    	{
    		case 1: return "08BIT";
    		case 2: return "16BIT";
    		case 3: return "24BIT";
    		break;
    	}
    	return NULL;
    }
    
    char* TYPE_NAMES(int i)
    {
    	switch (i)
    	{
    		case 1: return "Progressive";
    		case 2: return "Interlaced";
    		break;
    	}
    	return NULL;
    }
    
    #define MAX_SHIFTS	30
    /**
     * SECTION:element-omx_camera
     *
     * omx_camerasrc can be used to capture video and/or still frames from OMX
     * camera.<p>
     */
    static const GstElementDetails element_details =
    GST_ELEMENT_DETAILS ("Video OMX Camera Source",
        "Source/Video",
        "Reads frames from an OMX Camera Component",
        "David Soto <david.soto@ridgerun.com> - with dave edits");
    /*
     * Properties
     */
    enum
    {
      ARG_0,
      ARG_INPUT_INTERFACE,
      ARG_CAP_MODE,
      ARG_SCAN_TYPE,
      ARG_SKIP_FRAMES,
      ARG_VIF_MODE,
      ARG_OVERRIDE_COLORSPACE
    };
    
    GSTOMX_BOILERPLATE (GstOmxCamera, gst_omx_camera, GstOmxBaseSrc,
        GST_OMX_BASE_SRC_TYPE);
    
    /*
     * Caps:
     */
    static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
        GST_PAD_SRC,
        GST_PAD_ALWAYS,
        GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV_STRIDED (GSTOMX_ALL_FORMATS,
                "[ 0, max ]"))
        );
    
    static gboolean
    src_setcaps (GstPad * pad, GstCaps * caps)
    {
      GstOmxCamera *self = GST_OMX_CAMERA (GST_PAD_PARENT (pad));
      GstOmxBaseSrc *omx_base = GST_OMX_BASE_SRC (self);
    
      GstVideoFormat format;
      gint width, height, rowstride;
      OMX_ERRORTYPE err;
      GstStructure *structure;
    
      if (!self) {
        GST_DEBUG_OBJECT (pad, "pad has no parent (yet?)");
        return TRUE;                // ???
      }
    
      g_return_val_if_fail (caps, FALSE);
      g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);
    
      if (gst_video_format_parse_caps_strided (caps,
              &format, &width, &height, &rowstride)) {
    
        /* Output port configuration: */
        OMX_PARAM_PORTDEFINITIONTYPE param;
        gboolean configure_port = FALSE;
    
        G_OMX_PORT_GET_DEFINITION (self->port, &param);
    
        if ((param.format.video.nFrameWidth != width) ||
            (param.format.video.nFrameHeight != height) ||
            (param.format.video.nStride != rowstride)) {
          param.format.video.nFrameWidth = width;
          param.format.video.nFrameHeight = height;
          param.format.video.nStride = self->rowstride = width;
          configure_port = TRUE;
        }
    
        param.nBufferSize = gst_video_format_get_size_strided (format,
            width, height, rowstride);
        if (self->scan_type == OMX_VIDEO_CaptureScanTypeInterlaced)
          height = height / 2;
        /* special hack to work around OMX camera bug:
         */
        if (param.format.video.eColorFormat !=
            g_omx_gstvformat_to_colorformat (format)) {
          if (g_omx_gstvformat_to_colorformat (format) ==
              OMX_COLOR_FormatYUV420PackedSemiPlanar) {
            if (param.format.video.eColorFormat != OMX_COLOR_FormatYUV420SemiPlanar) {
              param.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
              configure_port = TRUE;
            }
          } else {
            param.format.video.eColorFormat =
                g_omx_gstvformat_to_colorformat (format);
            configure_port = TRUE;
          }
        }
    
    	if (self->override_colorspace)
    	{
    		param.format.video.eColorFormat = OMX_COLOR_FormatYCbYCr;
    		configure_port = TRUE;
    		printf("OVERRIDING COLORSPACE (forcing YUY2).....\n");
    	}
    
        /*Setting compression Format */
        param.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
    
        if (configure_port) {
    
          gboolean port_enabled = FALSE;
    
          if (self->port->enabled && (omx_base->gomx->omx_state != OMX_StateLoaded)) {
            g_omx_port_disable (self->port);
            port_enabled = TRUE;
          }
    
          err = G_OMX_PORT_SET_DEFINITION (self->port, &param);
          if (err != OMX_ErrorNone)
            return FALSE;
    
          if (port_enabled)
            g_omx_port_enable (self->port);
        }
    
        /* Setting Memory type at output port to Raw Memory */
        OMX_PARAM_BUFFER_MEMORYTYPE memTypeCfg;
        G_OMX_PORT_GET_DEFINITION (self->port, &memTypeCfg);
        memTypeCfg.eBufMemoryType = OMX_BUFFER_MEMORY_DEFAULT;
        G_OMX_PORT_SET_PARAM (self->port,
            OMX_TI_IndexParamBuffMemType, &memTypeCfg);
    
        /* capture on EIO card is component input at VIP1 port */
        OMX_PARAM_VFCC_HWPORT_ID sHwPortId;
        _G_OMX_INIT_PARAM (&sHwPortId);
        sHwPortId.eHwPortId = self->input_interface;
    printf("INPUT INTERFACE: %s\n", PORT_NAMES(sHwPortId.eHwPortId));
        G_OMX_PORT_SET_PARAM (self->port,
            (OMX_INDEXTYPE) OMX_TI_IndexParamVFCCHwPortID, (OMX_PTR) & sHwPortId);
    
        OMX_PARAM_VFCC_HWPORT_PROPERTIES sHwPortParam;
        _G_OMX_INIT_PARAM (&sHwPortParam);
        sHwPortParam.eCaptMode = self->cap_mode;
    printf("CAP MODE: %s\n", MODE_NAMES(sHwPortParam.eCaptMode));
        sHwPortParam.eVifMode = self->vif_mode;
    printf("VIF MODE: %s\n", VIF_NAMES(sHwPortParam.eVifMode));
        sHwPortParam.nMaxHeight = height;
        sHwPortParam.nMaxWidth = width;
        sHwPortParam.nMaxChnlsPerHwPort = 1;
        sHwPortParam.eScanType = self->scan_type;
    printf("INTERLACE MODE: %s\n", TYPE_NAMES(sHwPortParam.eScanType)); 
    
        structure = gst_caps_get_structure (caps, 0);
    
        if (!strcmp (gst_structure_get_name (structure), "video/x-raw-yuv")) {
          self->input_format = OMX_COLOR_FormatYCbYCr;
        } else if (!strcmp (gst_structure_get_name (structure), "video/x-raw-rgb")) {
          self->input_format = OMX_COLOR_Format24bitRGB888;
        } else
          return FALSE;
    
        sHwPortParam.eInColorFormat = self->input_format;
        G_OMX_PORT_SET_PARAM (self->port,
            (OMX_INDEXTYPE) OMX_TI_IndexParamVFCCHwPortProperties,
            (OMX_PTR) & sHwPortParam);
    
        if (!gst_pad_set_caps (GST_BASE_SRC_PAD (self), caps))
          return FALSE;
      }
      return TRUE;
    }
    
    static void
    setup_ports (GstOmxBaseSrc * base_src)
    {
      GstOmxCamera *self = GST_OMX_CAMERA (base_src);
    
      /*Configuring port to allocated buffers instead of use shared buffers */
      self->port->omx_allocate = TRUE;
      self->port->share_buffer = FALSE;
    }
    
    static GstClockTime
    get_timestamp (GstOmxCamera * self)
    {
      GstClock *clock;
      GstClockTime timestamp;
    
      /* timestamps, LOCK to get clock and base time. */
      GST_OBJECT_LOCK (self);
      if ((clock = GST_ELEMENT_CLOCK (self))) {
        /* we have a clock, get base time and ref clock */
        timestamp = GST_ELEMENT (self)->base_time;
        gst_object_ref (clock);
      } else {
        /* no clock, can't set timestamps */
        timestamp = GST_CLOCK_TIME_NONE;
      }
      GST_OBJECT_UNLOCK (self);
    
      if (clock) {
        /* the time now is the time of the clock minus the base time */
        /* Hack: Need to subtract the extra lag that is causing problems to AV sync */
        timestamp = gst_clock_get_time (clock) - timestamp - (65 * GST_MSECOND);
        gst_object_unref (clock);
    
        /* if we have a framerate adjust timestamp for frame latency */
    #if 0
        if (self->fps_n > 0 && self->fps_d > 0) {
          GstClockTime latency;
    
          latency =
              gst_util_uint64_scale_int (GST_SECOND, self->fps_d, self->fps_n);
    
          if (timestamp > latency)
            timestamp -= latency;
          else
            timestamp = 0;
        }
    #endif
      }
      return timestamp;
    }
    
    static void
    start_ports (GstOmxCamera * self)
    {
      g_omx_port_enable (self->port);
    }
    
    /*
     * GstBaseSrc Methods:
     */
    
    static GstFlowReturn
    create (GstBaseSrc * gst_base,
        guint64 offset, guint length, GstBuffer ** ret_buf)
    {
      GstOmxCamera *self = GST_OMX_CAMERA (gst_base);
      GstOmxBaseSrc *omx_base = GST_OMX_BASE_SRC (self);
      GstFlowReturn ret = GST_FLOW_NOT_NEGOTIATED;
      guint n_offset = 0;
    
      if (omx_base->gomx->omx_state == OMX_StateLoaded) {
        gst_omx_base_src_setup_ports (omx_base);
        g_omx_core_prepare (omx_base->gomx);
      }
    
      if (!self->alreadystarted) {
        self->alreadystarted = 1;
        start_ports (self);
      }
    
      ret = gst_omx_base_src_create_from_port (omx_base, self->port, ret_buf);
    
      n_offset = self->port->n_offset;
    
      if (ret != GST_FLOW_OK)
        goto fail;
    
      GST_BUFFER_TIMESTAMP (*ret_buf) = get_timestamp (self);
    
      return GST_FLOW_OK;
    
    fail:
      if (*ret_buf)
        gst_buffer_unref (*ret_buf);
      return ret;
    }
    
    /*
     * GObject Methods:
     */
    static void
    set_property (GObject * obj,
        guint prop_id, const GValue * value, GParamSpec * pspec)
    {
      GstOmxCamera *self = GST_OMX_CAMERA (obj);
      GstOmxBaseSrc *omx_base = GST_OMX_BASE_SRC (self);
      gchar *str_value;
      g_free (str_value);
    
      switch (prop_id) {
        case ARG_INPUT_INTERFACE:
        {
          str_value = g_value_dup_string (value);
          if (!strcmp (str_value, "VIP1_PORTA")) {
            self->input_interface = OMX_VIDEO_CaptureHWPortVIP1_PORTA;
          } else if (!strcmp (str_value, "VIP2_PORTA")) {
            self->input_interface = OMX_VIDEO_CaptureHWPortVIP2_PORTA;
          } else if (!strcmp (str_value, "VIP1_PORTB")) {
            self->input_interface = OMX_VIDEO_CaptureHWPortVIP1_PORTB;
          } else if (!strcmp (str_value, "VIP2_PORTB")) {
            self->input_interface = OMX_VIDEO_CaptureHWPortVIP2_PORTB;
          } else {
            GST_WARNING_OBJECT (omx_base, "%s unsupported", str_value);
            g_return_if_fail (0);
          }
          break;
        }
        case ARG_CAP_MODE:
        {
          str_value = g_value_dup_string (value);
          if (!strcmp (str_value, "MC_LINE_MUX"))
            self->cap_mode = OMX_VIDEO_CaptureModeMC_LINE_MUX;
          else if (!strcmp (str_value, "SC_NON_MUX"))
            self->cap_mode = OMX_VIDEO_CaptureModeSC_NON_MUX;
    	  else if (!strcmp (str_value, "MC_PEL_MUX"))
    		  self->cap_mode = OMX_VIDEO_CaptureModeMC_PEL_MUX;
    	  else if (!strcmp (str_value, "SC_DISCRETESYNC"))
    		  self->cap_mode = OMX_VIDEO_CaptureModeSC_DISCRETESYNC;
    	  else if (!strcmp (str_value, "MC_LINE_MUX_SPLIT_LINE"))
    		  self->cap_mode = OMX_VIDEO_CaptureModeMC_LINE_MUX_SPLIT_LINE;
    	  else if (!strcmp (str_value, "SC_DISCRETESYNC_ACTVID_VSYNC"))
    		  self->cap_mode = OMX_VIDEO_CaptureModeSC_DISCRETESYNC_ACTVID_VSYNC;
          else 
    	  {
            GST_WARNING_OBJECT (omx_base, "%s unsupported", str_value);
            g_return_if_fail (0);
          }
          break;
        }
        case ARG_SCAN_TYPE:
        {
          str_value = g_value_dup_string (value);
          if (!strcmp (str_value, "progressive")) {
            self->scan_type = OMX_VIDEO_CaptureScanTypeProgressive;
          } else if (!strcmp (str_value, "interlaced")) {
            self->scan_type = OMX_VIDEO_CaptureScanTypeInterlaced;
          } else {
            GST_WARNING_OBJECT (omx_base, "%s unsupported", str_value);
            g_return_if_fail (0);
          }
          break;
        }
        case ARG_SKIP_FRAMES:
        {
          OMX_CONFIG_VFCC_FRAMESKIP_INFO sCapSkipFrames;
          _G_OMX_INIT_PARAM (&sCapSkipFrames);
          guint32 shifts = 0, skip = 0, i = 0, count = 0;
          shifts = g_value_get_uint (value);
          if (shifts) {
            while (count < MAX_SHIFTS) {
    
              if ((count + shifts) > MAX_SHIFTS) {
                shifts = MAX_SHIFTS - count;
              }
              for (i = 0; i < shifts; i++) {
                skip = skip << 1;
                skip = skip | 1;
                count++;
              }
              if (count < MAX_SHIFTS) {
                skip = skip << 1;
                count++;
              }
            }
          }
    	  /*OMX_TI_IndexConfigVFCCFrameSkip is for dropping frames in capture,
    	    it is a binary 30bit value where 1 means drop a frame and 0
    		process the frame
    	    */
          sCapSkipFrames.frameSkipMask = skip;
          G_OMX_PORT_SET_CONFIG (self->port,
              OMX_TI_IndexConfigVFCCFrameSkip, &sCapSkipFrames);
          break;
        }
    
    	case ARG_VIF_MODE:
        {
          str_value = g_value_dup_string (value);
          if (!strcmp (str_value, "24BIT"))
            self->vif_mode = OMX_VIDEO_CaptureVifMode_24BIT;
          else if (!strcmp (str_value, "16BIT"))
            self->vif_mode = OMX_VIDEO_CaptureVifMode_16BIT;
          else
            self->vif_mode = OMX_VIDEO_CaptureVifMode_08BIT;
          break;
        }
    
    	case ARG_OVERRIDE_COLORSPACE:
        {
          str_value = g_value_dup_string (value);
          if (!strcmp (str_value, "true"))
            self->override_colorspace = TRUE;
          else
            self->override_colorspace = FALSE;
          break;
        }
    
        default:
        {
          G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
          break;
        }
      }
    }
    
    static void
    get_property (GObject * obj, guint prop_id, GValue * value, GParamSpec * pspec)
    {
      GstOmxCamera *self = GST_OMX_CAMERA (obj);
    
      switch (prop_id) {
        case ARG_INPUT_INTERFACE:
        {
          if (self->input_interface == OMX_VIDEO_CaptureHWPortVIP2_PORTA)
            g_value_set_string (value, "VIP2_PORTA");
          else if (self->input_interface == OMX_VIDEO_CaptureHWPortVIP2_PORTB)
            g_value_set_string (value, "VIP2_PORTB");
          else if (self->input_interface == OMX_VIDEO_CaptureHWPortVIP1_PORTB)
            g_value_set_string (value, "VIP1_PORTB");
          else
            g_value_set_string (value, "VIP1_PORTA");
          break;
        }
        case ARG_CAP_MODE:
        {
          if (self->cap_mode == OMX_VIDEO_CaptureModeMC_LINE_MUX)
    		  g_value_set_string (value, "MC_LINE_MUX");
    	  else if (self->cap_mode == OMX_VIDEO_CaptureModeMC_PEL_MUX)
    		  g_value_set_string (value, "MC_PEL_MUX");
    	  else if (self->cap_mode == OMX_VIDEO_CaptureModeSC_DISCRETESYNC)
    		  g_value_set_string (value, "SC_DISCRETESYNC");
    	  else if (self->cap_mode == OMX_VIDEO_CaptureModeMC_LINE_MUX_SPLIT_LINE)
    		  g_value_set_string (value, "MC_LINE_MUX_SPLIT_LINE");
    	  else if (self->cap_mode == OMX_VIDEO_CaptureModeSC_DISCRETESYNC_ACTVID_VSYNC)
    		  g_value_set_string (value, "SC_DISCRETESYNC_ACTVID_VSYNC");
          else
              g_value_set_string (value, "SC_NON_MUX");
          break;
        }
        case ARG_SCAN_TYPE:
        {
          if (self->scan_type == OMX_VIDEO_CaptureScanTypeProgressive)
            g_value_set_string (value, "progressive");
          else
            g_value_set_string (value, "interlaced");
          break;
        }
        case ARG_SKIP_FRAMES:
        {
          OMX_CONFIG_VFCC_FRAMESKIP_INFO sCapSkipFrames;
    
          G_OMX_PORT_GET_CONFIG (self->port,
              OMX_TI_IndexConfigVFCCFrameSkip, &sCapSkipFrames);
    
          g_value_set_uint (value, sCapSkipFrames.frameSkipMask);
          break;
        }
    
    	case ARG_VIF_MODE:
        {
          if (self->vif_mode == OMX_VIDEO_CaptureVifMode_24BIT)
            g_value_set_string (value, "24BIT");
          else if (self->vif_mode == OMX_VIDEO_CaptureVifMode_16BIT)
            g_value_set_string (value, "16BIT");
    	  else
    		g_value_set_string (value, "08BIT");
          break;
        }
    
    	case ARG_OVERRIDE_COLORSPACE:
        {
          if (self->override_colorspace == TRUE)
            g_value_set_string (value, "true");
          else
    		g_value_set_string (value, "false");
          break;
        }
    
        default:
        {
          G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
          break;
        }
      }
    }
    
    /*
     * Initialization:
     */
    
    static void
    type_base_init (gpointer g_class)
    {
      GstElementClass *element_class;
    
      element_class = GST_ELEMENT_CLASS (g_class);
    
      gst_element_class_set_details (element_class, &element_details);
    
      gst_element_class_add_pad_template (element_class,
          gst_static_pad_template_get (&src_template));
    }
    
    static void
    type_class_init (gpointer g_class, gpointer class_data)
    {
      GObjectClass *gobject_class;
      GstElementClass *gst_element_class;
    
      gobject_class = G_OBJECT_CLASS (g_class);
      gst_element_class = GST_ELEMENT_CLASS (g_class);
    
      GstBaseSrcClass *gst_base_src_class;
      GstOmxBaseSrcClass *omx_base_class;
    
      gst_base_src_class = GST_BASE_SRC_CLASS (g_class);
      omx_base_class = GST_OMX_BASE_SRC_CLASS (g_class);
    
      omx_base_class->out_port_index = OMX_CAMERA_PORT_VIDEO_OUT_VIDEO;
    
      /* GstBaseSrc methods: */
      gst_base_src_class->create = GST_DEBUG_FUNCPTR (create);
    
      /* GObject methods: */
      gobject_class->set_property = set_property;
      gobject_class->get_property = get_property;
    
      /* install properties: */
      g_object_class_install_property (gobject_class, ARG_INPUT_INTERFACE,
          g_param_spec_string ("input-interface", "Video input interface",
              "The video input interface from where capture image/video is obtained (see below)"
              "\n\t\t\t VIP1_PORTA "
              "\n\t\t\t VIP1_PORTB "
              "\n\t\t\t VIP2_PORTA "
              "\n\t\t\t VIP2_PORTB ", "VIP1_PORTA", G_PARAM_READWRITE));
    
      g_object_class_install_property (gobject_class, ARG_CAP_MODE,
          g_param_spec_string ("capture-mode", "Multiplex/Sync mode",
              "Video capture mode (Multiplexed/Sync) (see below)"
              "\n\t\t\t SC_NON_MUX "
    		  "\n\t\t\t MC_LINE_MUX "
    		  "\n\t\t\t MC_PEL_MUX "
    		  "\n\t\t\t SC_DISCRETESYNC "
    		  "\n\t\t\t MC_LINE_MUX_SPLIT_LINE "
    		  "\n\t\t\t SC_DISCRETESYNC_ACTVID_VSYNC ", "SC_NON_MUX", G_PARAM_READWRITE));
    
      g_object_class_install_property (gobject_class, ARG_SCAN_TYPE,
          g_param_spec_string ("scan-type", "Video scan mode",
              "Video scan mode (see below)"
              "\n\t\t\t progressive "
              "\n\t\t\t interlaced ", "progressive", G_PARAM_READWRITE));
    
      g_object_class_install_property (gobject_class, ARG_SKIP_FRAMES,
          g_param_spec_uint ("skip-frames", "skip frames",
              "Skip this amount of frames after a vaild frame",
              0, 30, 0, G_PARAM_READWRITE));
    
      g_object_class_install_property (gobject_class, ARG_VIF_MODE,
          g_param_spec_string ("vif-mode", "Bit width of capture",
              "Video capture size (8, 16, 24 bits) (see below)"
              "\n\t\t\t 08BIT "
    		  "\n\t\t\t 16BIT "
    		  "\n\t\t\t 24BIT ", "08BIT", G_PARAM_READWRITE));
    
      g_object_class_install_property (gobject_class, ARG_OVERRIDE_COLORSPACE,
          g_param_spec_string ("override-colorspace", "Force capture of YUY2 video",
              "Set to true to disable colorspace conversion in the camera"
              "\n\t\t\t true "
    		  "\n\t\t\t false ", "false", G_PARAM_READWRITE));
    
    }
    
    static void
    type_instance_init (GTypeInstance * instance, gpointer g_class)
    {
      GstOmxCamera *self = GST_OMX_CAMERA (instance);
      GstOmxBaseSrc *omx_base = GST_OMX_BASE_SRC (self);
      GstBaseSrc *basesrc = GST_BASE_SRC (self);
    
      self->alreadystarted = 0;
    
      omx_base->setup_ports = setup_ports;
    
      omx_base->gomx->use_timestamps = TRUE;
    
      /*Since OMXBaseSrc already created a port, this function is going
       *to return that port (omx_base->out_port)*/
      self->port = g_omx_core_get_port (omx_base->gomx, "out",
          OMX_CAMERA_PORT_VIDEO_OUT_VIDEO);
    
      gst_base_src_set_live (basesrc, TRUE);
    
      /* setup src pad (already created by basesrc): */
      gst_pad_set_setcaps_function (GST_BASE_SRC_PAD (basesrc),
          GST_DEBUG_FUNCPTR (src_setcaps));
    
      /*Initialize properties */
      self->input_interface = OMX_VIDEO_CaptureHWPortVIP1_PORTA;
      self->cap_mode = OMX_VIDEO_CaptureModeSC_NON_MUX;
      self->scan_type = OMX_VIDEO_CaptureScanTypeProgressive;
      self->vif_mode = OMX_VIDEO_CaptureVifMode_08BIT;
      self->override_colorspace = FALSE;
    
      /* disable all ports to begin with: */
      g_omx_port_disable (self->port);
    
    }
    

    Sorry for the delayed response, Siva.  For OMX configuration, we modified the Ridge Run omx_camera element (attached, I hope) to set-up 8-bit capture on a specified port. 

    We also made a hardware change in the daughter card.  Previous revision would feed the upper 16-bit wide video input port of the 8168 directly from the TVP5151.  In the new revision, the TVP5151 is connected to an FPGA, and the FPGA passes through to the lower video input port, allowing it to work on either the 8168 or the 8148.  Video capture works with FGPA as pass-through; however, we recently added FPGA code to drop alternate fields since we were havnig problems with the OMX de-interlace element.  We now treat the incoming video as a progressive 720x244 30Hz image, rather than an interlaced 60 Hz.

    Hope this helps!  I know how frustrating it can be when things don't work.

    Dave

  • Hi David,

    Thanks for the reply , i was given some other work and so couldn't look into the problem  further . Now i  have tried to capture 8-bit bt.656 embedded sync capture on VIP1 PORTB using the OMX application ,but my application hangs without capturing any frames .

    With the same OMX application ,i am able to capture bt.656 stream on VIP0 PORTA and a clear display . In our case too we have got a FPGA which acts like a pass-through and sends the bt.656 stream on VIP1 PORTB .

    I have gone through the attached file ,it lists out the configuration for VIP ports . This i have already done in my OMX application .

    Have you tried capturing using OMX application (OMX VFCC) on PORTB ? The OMX VFCC capture component is not capturing frames on PORTB ,Can you help me out what i can do in OMX framework for the capture to work on PORTB ?

    Any help is appreciated .

    Thanks,

    Siva .

  • Hi David,

    I have got the ridgerun gst-openmax plugins installed in my filesystem . I want to try bt.656 8-bit capture on PORTB  with ridgerun omx_camera element .

    gst-launch-0.10 omx_camera input-interface=VIP1_PORTA capture-mode=SC_NON_MUX scan-type=interlaced vif-mode=16BIT override-colorspace=false ! filesink location=/home/root/sample.yuv

    I am expecting the above pipeline to do a 16-bit capture bt.1120 on VIP1 PORTA , but the sample.yuv file  is empty . This was working with OMX application .

    Can you send me the gstreamer working pipelines for capturing 16-bit or 8-bit on PORTA using omx_camera element ?

    Thanks,

    Siva .

  • Hi, 

    Have you tried with some of the pipelines suggested here:

    https://www.ridgerun.com/developer/wiki/index.php/Gstreamer_pipelines_for_DM816x_and_DM814x

    likely you will need to modify the omx_tvp plugin as well

    -David