Esempio n. 1
0
        static vpx_image_t vp8_get_frame(vpx_codec_alg_priv_t ctx, vpx_codec_iter_t iter)
        {
            vpx_image_t img = null;

            /* iter acts as a flip flop, so an image is only returned on the first
             * call to get_frame.
             */
            if (iter == IntPtr.Zero && ctx.yv12_frame_buffers.pbi[0] != null)
            {
                YV12_BUFFER_CONFIG sd = new YV12_BUFFER_CONFIG();
                long          time_stamp = 0, time_end_stamp = 0;
                vp8_ppflags_t flags = new vp8_ppflags_t();
                // Port AC: ppflags struct will be initialised to zero by default.
                //vp8_zero(flags);

                //if ([email protected]_flags & VPX_CODEC_USE_POSTPROC) {
                //    flags.post_proc_flag = ctx->postproc_cfg.post_proc_flag;
                //    flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
                //    flags.noise_level = ctx->postproc_cfg.noise_level;
                //}

                if (0 == onyxd.vp8dx_get_raw_frame(ctx.yv12_frame_buffers.pbi[0], ref sd,
                                                   out time_stamp, out time_end_stamp, ref flags))
                {
                    yuvconfig2image(ctx.img, sd, ctx.user_priv);

                    img = ctx.img;
                    //*iter = img;
                }
            }

            return(img);
        }
Esempio n. 2
0
        public static int vp8dx_get_raw_frame(VP8D_COMP pbi, ref YV12_BUFFER_CONFIG sd,
                                              out long time_stamp, out long time_end_stamp,
                                              ref vp8_ppflags_t flags)
        {
            int ret = -1;

            time_stamp     = 0;
            time_end_stamp = 0;

            if (pbi.ready_for_new_data == 1)
            {
                return(ret);
            }

            /* ie no raw frame to show!!! */
            if (pbi.common.show_frame == 0)
            {
                return(ret);
            }

            pbi.ready_for_new_data = 1;
            time_stamp             = pbi.last_time_stamp;
            time_end_stamp         = 0;

            //(void)flags;

            if (pbi.common.frame_to_show != null)
            {
                sd           = pbi.common.frame_to_show;
                sd.y_width   = pbi.common.Width;
                sd.y_height  = pbi.common.Height;
                sd.uv_height = pbi.common.Height / 2;
                ret          = 0;
            }
            else
            {
                ret = -1;
            }

            // Port AC: Noop in libvpx.
            //vpx_clear_system_state();
            return(ret);
        }