static gboolean gst_aml_vdec_close(GstVideoDecoder * dec) { GstAmlVdec *amlvdec = GST_AMLVDEC(dec); gint ret=0; GST_ERROR("%s,%d\n",__FUNCTION__,__LINE__); stop_eos_task (amlvdec); if (amlvdec->codec_init_ok) { amlvdec->codec_init_ok = 0; if (amlvdec->is_paused == TRUE) { ret = codec_resume(amlvdec->pcodec); if (ret != 0) { GST_ERROR("[%s:%d]resume failed!ret=%d", __FUNCTION__, __LINE__, ret); } else amlvdec->is_paused = FALSE; } set_black_policy(1); codec_close(amlvdec->pcodec); amlvdec->is_headerfeed = FALSE; if (amlvdec->input_state) { gst_video_codec_state_unref(amlvdec->input_state); amlvdec->input_state = NULL; } set_fb0_blank(0); set_fb1_blank(0); //T? set_display_axis(1); } if (amlvdec->info) { amlvdec->info->finalize(amlvdec->info); amlvdec->info = NULL; } #if DEBUG_DUMP if (amlvdec->dump_fd > 0) { codec_set_dump_fd(NULL, 0); close(amlvdec->dump_fd); } #endif if (amlvdec->pcodec) { g_free(amlvdec->pcodec); amlvdec->pcodec = NULL; } return TRUE; }
static gboolean gst_set_vstream_info(GstAmlVdec *amlvdec, GstCaps * caps) { GstStructure *structure; const char *name; gint32 ret = CODEC_ERROR_NONE; AmlStreamInfo *videoinfo = NULL; int coordinate[4] = {0, 0, 0, 0}; structure = gst_caps_get_structure(caps, 0); name = gst_structure_get_name(structure); videoinfo = amlVstreamInfoInterface(name); if (NULL == name) { return FALSE; } amlvdec->info = videoinfo; videoinfo->init(videoinfo, amlvdec->pcodec, structure); if (amlvdec->pcodec && amlvdec->pcodec->stream_type == STREAM_TYPE_ES_VIDEO) { if (!amlvdec->codec_init_ok) { ret = codec_init(amlvdec->pcodec); if (ret != CODEC_ERROR_NONE) { GST_ERROR("codec init failed, ret=-0x%x", -ret); return FALSE; } set_fb0_blank(1); set_fb1_blank(1); set_tsync_enable(1); set_display_axis(coordinate); //set_video_axis(coordinate); amlvdec->codec_init_ok = 1; if (amlvdec->trickRate > 0) { if (amlvdec->pcodec && amlvdec->pcodec->cntl_handle) { //T codec_set_video_playrate(amlvdec->pcodec, (int) (amlvdec->trickRate * (1 << 16))); } } GST_DEBUG_OBJECT(amlvdec, "video codec_init ok"); } } return TRUE; }
int SYS_enable_osd0(void) { set_fb0_blank(0); return 0; }
int SYS_disable_osd0(void) { set_fb0_blank(1); return 0; }