Ejemplo n.º 1
0
static OMX_ERRORTYPE h264d_release_all_headers(vid_dec_PrivateType* priv)
{
   assert(priv);
   release_input_headers(priv);
   release_output_header(priv);

   return OMX_ErrorNone;
}
Ejemplo n.º 2
0
OMX_ERRORTYPE
deliver_codec_metadata (mp4dmuxflt_prc_t * ap_prc, const OMX_U32 a_pid)
{
  OMX_BUFFERHEADERTYPE * p_hdr = NULL;
  bool * p_metadata_delivered = NULL;
  tiz_buffer_t * p_out_store = NULL;
  tiz_vector_t * p_header_lengths = NULL;

  assert (ap_prc);

  p_metadata_delivered = ARATELIA_MP4_DEMUXER_FILTER_PORT_1_INDEX == a_pid
                           ? &(ap_prc->audio_metadata_delivered_)
                           : &(ap_prc->video_metadata_delivered_);
  assert (p_metadata_delivered);

  p_out_store = ARATELIA_MP4_DEMUXER_FILTER_PORT_1_INDEX == a_pid
                  ? ap_prc->p_aud_store_
                  : ap_prc->p_vid_store_;
  assert (p_out_store);

  p_header_lengths = ARATELIA_MP4_DEMUXER_FILTER_PORT_1_INDEX == a_pid
                       ? ap_prc->p_aud_header_lengths_
                       : ap_prc->p_vid_header_lengths_;
  assert (p_header_lengths);

  if (tiz_vector_length (p_header_lengths) > 0)
    {
      if (tiz_buffer_available (p_out_store)
          && (p_hdr = tiz_filter_prc_get_header (ap_prc, a_pid)))
        {
          size_t headerlen = 0;
          size_t nbytes_to_copy = 0;
          size_t * p_headerlen = tiz_vector_at (p_header_lengths, (OMX_S32) 0);
          assert (p_headerlen);
          headerlen = *p_headerlen;

          /* Copy the data into the omx buffer */
          nbytes_to_copy = MIN (TIZ_OMX_BUF_AVAIL (p_hdr), headerlen);
          memcpy (TIZ_OMX_BUF_PTR (p_hdr) + p_hdr->nFilledLen,
                  tiz_buffer_get (p_out_store), nbytes_to_copy);
          tiz_buffer_advance (p_out_store, nbytes_to_copy);
          p_hdr->nFilledLen += nbytes_to_copy;
          tiz_vector_erase (p_header_lengths, (OMX_S32) 0, (OMX_S32) 1);
          tiz_check_omx (release_output_header (ap_prc, a_pid));
        }
    }

  if (0 == tiz_vector_length (p_header_lengths))
    {
      *p_metadata_delivered = true;
    }

  return OMX_ErrorNone;
}
Ejemplo n.º 3
0
static OMX_ERRORTYPE h264d_prc_port_flush(const void *ap_obj, OMX_U32 a_pid)
{
   vid_dec_PrivateType*priv = (vid_dec_PrivateType*) ap_obj;
   if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_INPUT_PORT_INDEX == a_pid) {
      release_input_headers(priv);
      reset_stream_parameters(priv);
   }
   if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX == a_pid) {
      release_output_header(priv);
   }
   return OMX_ErrorNone;
}
Ejemplo n.º 4
0
static OMX_ERRORTYPE h264d_prc_port_disable(const void *ap_obj, OMX_U32 a_pid)
{
   vid_dec_PrivateType*priv = (vid_dec_PrivateType*) ap_obj;
   assert(priv);
   if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_INPUT_PORT_INDEX == a_pid) {
      /* Release all buffers */
      h264d_release_all_headers(priv);
      reset_stream_parameters(priv);
      priv->in_port_disabled_ = true;
   }
   if (OMX_ALL == a_pid || OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX == a_pid) {
      release_output_header(priv);
      priv->out_port_disabled_ = true;
   }
   return OMX_ErrorNone;
}