//重播 bool CTsPlayer::ResetPlay() { int iRet = 0; if(0 != pcodec){ iRet = codec_reset(pcodec); } return !iRet; }
int aml_submit_decode_unit(PDECODE_UNIT decodeUnit) { int result = DR_OK; PLENTRY entry = decodeUnit->bufferList; while (entry != NULL) { int api = codec_write(&codecParam, entry->data, entry->length); if (api != entry->length) { fprintf(stderr, "codec_write error: %x\n", api); codec_reset(&codecParam); result = DR_NEED_IDR; break; } entry = entry->next; } return result; }
void mcbspSetup() { mcbspControlHandle = MCBSP_open(MCBSP_DEV0, MCBSP_OPEN_RESET); mcbspDataHandle = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); if(mcbspControlHandle == INV || mcbspDataHandle == INV) { return; } MCBSP_config(mcbspControlHandle, &mcbsp_control_config); MCBSP_config(mcbspDataHandle, &mcbsp_data_config); MCBSP_start(mcbspControlHandle, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220); codec_reset(); codec_config(); if (MCBSP_rrdy(mcbspDataHandle)) MCBSP_read(mcbspDataHandle); MCBSP_start(mcbspDataHandle, MCBSP_XMIT_START | MCBSP_RCV_START | MCBSP_SRGR_START | MCBSP_SRGR_FRAMESYNC, 220); }
static gboolean gst_amlvdec_sink_event (GstVideoDecoder * dec, GstEvent * event) { gboolean ret = TRUE; GstAmlVdec *amlvdec = GST_AMLVDEC(dec); GST_ERROR_OBJECT (amlvdec, "Got %s event on sink pad", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { /* case GST_EVENT_NEWSEGMENT: { gboolean update; GstFormat format; gdouble rate, arate; gint64 start, stop, time; stop_eos_task (amlvdec); gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format, &start, &stop, &time); if (format != GST_FORMAT_TIME) goto newseg_wrong_format; amlvdec_forward_process(amlvdec, update, rate, format, start, stop, time); gst_segment_set_newsegment_full (&amlvdec->segment, update, rate, arate, format, start, stop, time); GST_DEBUG_OBJECT (amlvdec,"Pushing newseg rate %g, applied rate %g, format %d, start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT ", pos %" G_GINT64_FORMAT, rate, arate, format, start, stop, time); ret = gst_pad_push_event (amlvdec->srcpad, event); break; }*/ case GST_EVENT_FLUSH_START: if(amlvdec->codec_init_ok){ set_black_policy(0); } ret = TRUE; break; case GST_EVENT_FLUSH_STOP: { stop_eos_task (amlvdec); if(amlvdec->codec_init_ok){ gint res = -1; res = codec_reset(amlvdec->pcodec); if (res < 0) { GST_ERROR("reset vcodec failed, res= %x\n", res); return FALSE; } amlvdec->is_headerfeed = FALSE; } GST_WARNING("vformat:%d\n", amlvdec->pcodec->video_type); break; } case GST_EVENT_EOS: GST_WARNING("get GST_EVENT_EOS,check for video end\n"); if(amlvdec->codec_init_ok) { start_eos_task(amlvdec); amlvdec->is_eos = TRUE; } ret = TRUE; break; default: break; } done: ret = GST_VIDEO_DECODER_CLASS (parent_class)->sink_event (amlvdec, event); return ret; }