#include <bellagio/omxcore.h>
#endif
-#include <bellagio/omx_base_video_port.h>
-
#include "pipe/p_screen.h"
#include "pipe/p_video_codec.h"
#include "util/u_memory.h"
if (msg->messageType == OMX_CommandStateSet) {
if ((msg->messageParam == OMX_StateIdle ) && (priv->state == OMX_StateLoaded)) {
-
- struct pipe_video_codec templat = {};
- omx_base_video_PortType *port;
-
- port = (omx_base_video_PortType *)priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
-
- templat.profile = priv->profile;
- templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
- templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
- templat.width = port->sPortParam.format.video.nFrameWidth;
- templat.height = port->sPortParam.format.video.nFrameHeight;
- templat.max_references = 2;
- templat.expect_chunked_decode = true;
-
- priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
-
if (priv->profile == PIPE_VIDEO_PROFILE_MPEG2_MAIN)
vid_dec_mpeg12_Init(priv);
else if (priv->profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH)
#include <bellagio/st_static_component_loader.h>
#include <bellagio/omx_base_filter.h>
+#include <bellagio/omx_base_video_port.h>
#include "pipe/p_video_state.h"
#include "state_tracker/drm_driver.h"
priv->picture.h264.num_ref_frames = priv->picture.h264.pps->sps->max_num_ref_frames;
+ if (!priv->codec) {
+ struct pipe_video_codec templat = {};
+ omx_base_video_PortType *port;
+
+ port = (omx_base_video_PortType *)priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
+ templat.profile = priv->profile;
+ templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
+ templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
+ templat.max_references = 2;
+ templat.expect_chunked_decode = true;
+ templat.width = port->sPortParam.format.video.nFrameWidth;
+ templat.height = port->sPortParam.format.video.nFrameHeight;
+
+ priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
+ }
priv->codec->begin_frame(priv->codec, priv->target, &priv->picture.base);
priv->frame_started = true;
}
void vid_dec_mpeg12_Init(vid_dec_PrivateType *priv)
{
+ struct pipe_video_codec templat = {};
+ omx_base_video_PortType *port;
+
+ port = (omx_base_video_PortType *)priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
+ templat.profile = priv->profile;
+ templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
+ templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
+ templat.max_references = 2;
+ templat.expect_chunked_decode = true;
+ templat.width = port->sPortParam.format.video.nFrameWidth;
+ templat.height = port->sPortParam.format.video.nFrameHeight;
+
+ priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
+
priv->picture.base.profile = PIPE_VIDEO_PROFILE_MPEG2_MAIN;
priv->picture.mpeg12.intra_matrix = default_intra_matrix;
priv->picture.mpeg12.non_intra_matrix = default_non_intra_matrix;