mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 10:38:27 +00:00
omxvideo{dec,enc}: Don't use the input state if it wasn't set yet
This commit is contained in:
parent
d92fb127ae
commit
687a188dad
2 changed files with 4 additions and 6 deletions
|
@ -926,7 +926,6 @@ gst_omx_video_dec_get_supported_colorformats (GstOMXVideoDec * self)
|
||||||
{
|
{
|
||||||
GstOMXPort *port = self->dec_out_port;
|
GstOMXPort *port = self->dec_out_port;
|
||||||
GstVideoCodecState *state = self->input_state;
|
GstVideoCodecState *state = self->input_state;
|
||||||
GstVideoInfo *info = &state->info;
|
|
||||||
OMX_VIDEO_PARAM_PORTFORMATTYPE param;
|
OMX_VIDEO_PARAM_PORTFORMATTYPE param;
|
||||||
OMX_ERRORTYPE err;
|
OMX_ERRORTYPE err;
|
||||||
GList *negotiation_map = NULL;
|
GList *negotiation_map = NULL;
|
||||||
|
@ -935,10 +934,10 @@ gst_omx_video_dec_get_supported_colorformats (GstOMXVideoDec * self)
|
||||||
GST_OMX_INIT_STRUCT (¶m);
|
GST_OMX_INIT_STRUCT (¶m);
|
||||||
param.nPortIndex = port->index;
|
param.nPortIndex = port->index;
|
||||||
param.nIndex = 0;
|
param.nIndex = 0;
|
||||||
if (info->fps_n == 0)
|
if (!state || state->info.fps_n == 0)
|
||||||
param.xFramerate = 0;
|
param.xFramerate = 0;
|
||||||
else
|
else
|
||||||
param.xFramerate = (info->fps_n << 16) / (info->fps_d);
|
param.xFramerate = (state->info.fps_n << 16) / (state->info.fps_d);
|
||||||
|
|
||||||
old_index = -1;
|
old_index = -1;
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -1012,7 +1012,6 @@ gst_omx_video_enc_get_supported_colorformats (GstOMXVideoEnc * self)
|
||||||
{
|
{
|
||||||
GstOMXPort *port = self->enc_in_port;
|
GstOMXPort *port = self->enc_in_port;
|
||||||
GstVideoCodecState *state = self->input_state;
|
GstVideoCodecState *state = self->input_state;
|
||||||
GstVideoInfo *info = &state->info;
|
|
||||||
OMX_VIDEO_PARAM_PORTFORMATTYPE param;
|
OMX_VIDEO_PARAM_PORTFORMATTYPE param;
|
||||||
OMX_ERRORTYPE err;
|
OMX_ERRORTYPE err;
|
||||||
GList *negotiation_map = NULL;
|
GList *negotiation_map = NULL;
|
||||||
|
@ -1021,10 +1020,10 @@ gst_omx_video_enc_get_supported_colorformats (GstOMXVideoEnc * self)
|
||||||
GST_OMX_INIT_STRUCT (¶m);
|
GST_OMX_INIT_STRUCT (¶m);
|
||||||
param.nPortIndex = port->index;
|
param.nPortIndex = port->index;
|
||||||
param.nIndex = 0;
|
param.nIndex = 0;
|
||||||
if (info->fps_n == 0)
|
if (!state || state->info.fps_n == 0)
|
||||||
param.xFramerate = 0;
|
param.xFramerate = 0;
|
||||||
else
|
else
|
||||||
param.xFramerate = (info->fps_n << 16) / (info->fps_d);
|
param.xFramerate = (state->info.fps_n << 16) / (state->info.fps_d);
|
||||||
|
|
||||||
old_index = -1;
|
old_index = -1;
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in a new issue