diff --git a/board/miyoo/kernel/patch/musl/0001-enable-cedar.patch b/board/miyoo/kernel/patch/musl/0001-enable-cedar.patch new file mode 100644 index 00000000..0ea5751b --- /dev/null +++ b/board/miyoo/kernel/patch/musl/0001-enable-cedar.patch @@ -0,0 +1,38 @@ +diff --git a/arch/arm/configs/miyoo_defconfig b/arch/arm/configs/miyoo_defconfig +index f9cb0790f..625b5a30f 100644 +--- a/arch/arm/configs/miyoo_defconfig ++++ b/arch/arm/configs/miyoo_defconfig +@@ -83,6 +83,12 @@ CONFIG_SUNXI_WATCHDOG=y + CONFIG_MFD_SYSCON=y + CONFIG_REGULATOR=y + CONFIG_REGULATOR_FIXED_VOLTAGE=y ++# CONFIG_MEDIA_CEC_SUPPORT is not set ++CONFIG_MEDIA_SUPPORT=y ++# CONFIG_VIDEO_DEV is not set ++# CONFIG_MEDIA_CONTROLLER is not set ++# CONFIG_DVB_NET is not set ++# CONFIG_DVB_DYNAMIC_MINORS is not set + CONFIG_FB=y + CONFIG_FB_MIYOO_VIDEO=y + CONFIG_FB_R61520=m +@@ -122,6 +128,10 @@ CONFIG_USB_CONFIGFS_F_HID=y + CONFIG_MMC=y + CONFIG_MMC_SUNXI=y + CONFIG_STAGING=y ++CONFIG_STAGING_MEDIA=y ++CONFIG_VIDEO_SUNXI=y ++CONFIG_VIDEO_SUNXI_CEDAR_VE=y ++CONFIG_VIDEO_SUNXI_CEDAR_ION=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_PWM=y + CONFIG_PWM_SUNIV=y +@@ -144,6 +154,9 @@ CONFIG_CRYPTO_DRBG_MENU=y + # CONFIG_CRYPTO_HW is not set + CONFIG_LIBCRC32C=y + CONFIG_XZ_DEC=y ++CONFIG_DMA_PERNUMA_CMA=y ++CONFIG_CMA_SIZE_MBYTES=12 ++CONFIG_CMA_ALIGNMENT=4 + CONFIG_PRINTK_TIME=y + CONFIG_CONSOLE_LOGLEVEL_DEFAULT=4 + # CONFIG_FTRACE is not set diff --git a/board/miyoo/kernel/patch/musl/0002-video-increase-VRAM.patch b/board/miyoo/kernel/patch/musl/0002-video-increase-VRAM.patch new file mode 100644 index 00000000..7b3a6a51 --- /dev/null +++ b/board/miyoo/kernel/patch/musl/0002-video-increase-VRAM.patch @@ -0,0 +1,95 @@ +From 16996fbd2c84692c6bc8c426524e870a6c826550 Mon Sep 17 00:00:00 2001 +From: tiopex +Date: Fri, 11 Jul 2025 23:57:28 +0200 +Subject: [PATCH] video: increase VRAM + +--- + drivers/video/fbdev/gc9306fb.c | 2 +- + drivers/video/fbdev/hx8347dfb.c | 2 +- + drivers/video/fbdev/r61520fb.c | 2 +- + drivers/video/fbdev/rm68090fb.c | 2 +- + drivers/video/fbdev/st7789sTEfb.c | 2 +- + drivers/video/fbdev/st7789sfb.c | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/video/fbdev/gc9306fb.c b/drivers/video/fbdev/gc9306fb.c +index 4ecfbe9fb..f4cfef6a1 100644 +--- a/drivers/video/fbdev/gc9306fb.c ++++ b/drivers/video/fbdev/gc9306fb.c +@@ -613,7 +613,7 @@ static int myfb_probe(struct platform_device *device) + par->bpp = 16; + fb_videomode_to_var(&myfb_var, mode); + +- par->vram_size = 320 * 240 * 2 * 2; ++ par->vram_size = 640 * 480 * 2 * 2; + par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA); + if(!par->vram_virt){ + return -EINVAL; +diff --git a/drivers/video/fbdev/hx8347dfb.c b/drivers/video/fbdev/hx8347dfb.c +index c6b337999..80a0cc639 100644 +--- a/drivers/video/fbdev/hx8347dfb.c ++++ b/drivers/video/fbdev/hx8347dfb.c +@@ -748,7 +748,7 @@ static int myfb_probe(struct platform_device *device) + par->bpp = 16; + fb_videomode_to_var(&myfb_var, mode); + +- par->vram_size = 320*240*2*2; ++ par->vram_size = 640*480*2*2; + par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA); + if(!par->vram_virt){ + dev_err(&device->dev, "%s, failed to allocate frame buffer(vram)\n", __func__); +diff --git a/drivers/video/fbdev/r61520fb.c b/drivers/video/fbdev/r61520fb.c +index ca1d8562f..c657efc70 100644 +--- a/drivers/video/fbdev/r61520fb.c ++++ b/drivers/video/fbdev/r61520fb.c +@@ -1566,7 +1566,7 @@ static int myfb_probe(struct platform_device *device) + par->bpp = 16; + fb_videomode_to_var(&myfb_var, mode); + +- par->vram_size = 320*240*2*2; ++ par->vram_size = 640*480*2*2; + par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA); + if(!par->vram_virt){ + dev_err(&device->dev, "%s, failed to allocate frame buffer(vram)\n", __func__); +diff --git a/drivers/video/fbdev/rm68090fb.c b/drivers/video/fbdev/rm68090fb.c +index b3dcbe48b..1cf7268a7 100644 +--- a/drivers/video/fbdev/rm68090fb.c ++++ b/drivers/video/fbdev/rm68090fb.c +@@ -684,7 +684,7 @@ static int myfb_probe(struct platform_device *device) + par->bpp = 16; + fb_videomode_to_var(&myfb_var, mode); + +- par->vram_size = 320*240*2*2; ++ par->vram_size = 640*480*2*2; + par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA); + if(!par->vram_virt){ + dev_err(&device->dev, "%s, failed to allocate frame buffer(vram)\n", __func__); +diff --git a/drivers/video/fbdev/st7789sTEfb.c b/drivers/video/fbdev/st7789sTEfb.c +index ee895b575..176f11416 100644 +--- a/drivers/video/fbdev/st7789sTEfb.c ++++ b/drivers/video/fbdev/st7789sTEfb.c +@@ -687,7 +687,7 @@ static int myfb_probe(struct platform_device *device) + par->bpp = 16; + fb_videomode_to_var(&myfb_var, mode); + +- par->vram_size = (320 * 240 * 2 * 4) + 4096; ++ par->vram_size = (640 * 480 * 2 * 4) + 4096; + par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t *)&par->vram_phys, GFP_KERNEL | GFP_DMA); + if(!par->vram_virt) { + return -EINVAL; +diff --git a/drivers/video/fbdev/st7789sfb.c b/drivers/video/fbdev/st7789sfb.c +index 28ef0ce8c..8867701ad 100644 +--- a/drivers/video/fbdev/st7789sfb.c ++++ b/drivers/video/fbdev/st7789sfb.c +@@ -806,7 +806,7 @@ static int myfb_probe(struct platform_device *device) + par->bpp = 16; + fb_videomode_to_var(&myfb_var, mode); + +- par->vram_size = (320 * 240 * 2 * 4) + 4096; ++ par->vram_size = (640 * 480 * 2 * 4) + 4096; + par->vram_virt = dma_alloc_coherent(par->dev, par->vram_size, (resource_size_t*)&par->vram_phys, GFP_KERNEL | GFP_DMA); + if (!par->vram_virt) { + return -EINVAL; +-- +2.34.1 + diff --git a/board/miyoo/main/gmenu2x/sections/applications/gstreamer-play b/board/miyoo/main/gmenu2x/sections/applications/gstreamer-play new file mode 100644 index 00000000..3e1acaf2 --- /dev/null +++ b/board/miyoo/main/gmenu2x/sections/applications/gstreamer-play @@ -0,0 +1,4 @@ +title=Gstreamer HW player +description=Play a movie/audio file using HW decoder cedar +exec=/usr/bin/gst-play +selectordir=/mnt/output diff --git a/board/miyoo/patches/gst-omx/0001-gst-omx-adapter-omx-to-Cedarc.patch b/board/miyoo/patches/gst-omx/0001-gst-omx-adapter-omx-to-Cedarc.patch new file mode 100755 index 00000000..55aca239 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0001-gst-omx-adapter-omx-to-Cedarc.patch @@ -0,0 +1,3259 @@ +From 104e91cb1f806fff42f6d5bb8fc514b94e944f09 Mon Sep 17 00:00:00 2001 +From: xiebin +Date: Tue, 2 May 2017 16:10:36 +0800 +Subject: [PATCH] change + +--- + config/bellagio/gstomx.conf | 239 +++++++++++++++++++++++++++++++++++++++++--- + omx/Makefile.am | 36 ++++++- + omx/gstomx.c | 27 ++++- + omx/gstomxavsdec.c | 98 ++++++++++++++++++ + omx/gstomxavsdec.h | 60 +++++++++++ + omx/gstomxdivx4dec.c | 99 ++++++++++++++++++ + omx/gstomxdivx4dec.h | 60 +++++++++++ + omx/gstomxdivxdec.c | 101 +++++++++++++++++++ + omx/gstomxdivxdec.h | 60 +++++++++++ + omx/gstomxflv1dec.c | 99 ++++++++++++++++++ + omx/gstomxflv1dec.h | 60 +++++++++++ + omx/gstomxh265dec.c | 98 ++++++++++++++++++ + omx/gstomxh265dec.h | 60 +++++++++++ + omx/gstomxmpeg1dec.c | 100 ++++++++++++++++++ + omx/gstomxmpeg1dec.h | 60 +++++++++++ + omx/gstomxmpeg2videodec.c | 2 +- + omx/gstomxmpeg4videodec.c | 7 +- + omx/gstomxmsmpeg4v1dec.c | 99 ++++++++++++++++++ + omx/gstomxmsmpeg4v1dec.h | 60 +++++++++++ + omx/gstomxmsmpeg4v2dec.c | 99 ++++++++++++++++++ + omx/gstomxmsmpeg4v2dec.h | 60 +++++++++++ + omx/gstomxmsmpeg4v3dec.c | 99 ++++++++++++++++++ + omx/gstomxmsmpeg4v3dec.h | 60 +++++++++++ + omx/gstomxrv20dec.c | 99 ++++++++++++++++++ + omx/gstomxrv20dec.h | 60 +++++++++++ + omx/gstomxrxdec.c | 99 ++++++++++++++++++ + omx/gstomxrxdec.h | 60 +++++++++++ + omx/gstomxvp6dec.c | 98 ++++++++++++++++++ + omx/gstomxvp6dec.h | 60 +++++++++++ + omx/gstomxvp9dec.c | 98 ++++++++++++++++++ + omx/gstomxvp9dec.h | 60 +++++++++++ + omx/gstomxwmv1dec.c | 99 ++++++++++++++++++ + omx/gstomxwmv1dec.h | 60 +++++++++++ + omx/gstomxwmv2dec.c | 99 ++++++++++++++++++ + omx/gstomxwmv2dec.h | 60 +++++++++++ + omx/gstomxxviddec.c | 98 ++++++++++++++++++ + omx/gstomxxviddec.h | 60 +++++++++++ + omx/openmax/OMX_Video.h | 20 ++++ + 38 files changed, 2851 insertions(+), 22 deletions(-) + create mode 100644 omx/gstomxavsdec.c + create mode 100644 omx/gstomxavsdec.h + create mode 100644 omx/gstomxdivx4dec.c + create mode 100644 omx/gstomxdivx4dec.h + create mode 100644 omx/gstomxdivxdec.c + create mode 100644 omx/gstomxdivxdec.h + create mode 100644 omx/gstomxflv1dec.c + create mode 100644 omx/gstomxflv1dec.h + create mode 100644 omx/gstomxh265dec.c + create mode 100644 omx/gstomxh265dec.h + create mode 100644 omx/gstomxmpeg1dec.c + create mode 100644 omx/gstomxmpeg1dec.h + create mode 100644 omx/gstomxmsmpeg4v1dec.c + create mode 100644 omx/gstomxmsmpeg4v1dec.h + create mode 100644 omx/gstomxmsmpeg4v2dec.c + create mode 100644 omx/gstomxmsmpeg4v2dec.h + create mode 100644 omx/gstomxmsmpeg4v3dec.c + create mode 100644 omx/gstomxmsmpeg4v3dec.h + create mode 100644 omx/gstomxrv20dec.c + create mode 100644 omx/gstomxrv20dec.h + create mode 100644 omx/gstomxrxdec.c + create mode 100644 omx/gstomxrxdec.h + create mode 100644 omx/gstomxvp6dec.c + create mode 100644 omx/gstomxvp6dec.h + create mode 100644 omx/gstomxvp9dec.c + create mode 100644 omx/gstomxvp9dec.h + create mode 100644 omx/gstomxwmv1dec.c + create mode 100644 omx/gstomxwmv1dec.h + create mode 100644 omx/gstomxwmv2dec.c + create mode 100644 omx/gstomxwmv2dec.h + create mode 100644 omx/gstomxxviddec.c + create mode 100644 omx/gstomxxviddec.h + +diff --git a/config/bellagio/gstomx.conf b/config/bellagio/gstomx.conf +index 5ca8ba6..cf27588 100644 +--- a/config/bellagio/gstomx.conf ++++ b/config/bellagio/gstomx.conf +@@ -1,35 +1,242 @@ ++[omxmpeg2videodec] ++type-name=GstOMXMPEG2VideoDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.mpeg2 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxmjpegvideodec] ++type-name=GstOMXMJPEGDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.mjpeg ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxmpeg1videodec] ++type-name=GstOMXMPEG1Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.mpeg1 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ + [omxmpeg4videodec] + type-name=GstOMXMPEG4VideoDec +-core-name=/usr/local/lib/libomxil-bellagio.so.0 +-component-name=OMX.st.video_decoder.mpeg4 ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.mpeg4 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxmsmpeg4v1videodec] ++type-name=GstOMXMSMPEG4V1Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.msmpeg4v1 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxmsmpeg4v2videodec] ++type-name=GstOMXMSMPEG4V2Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.msmpeg4v2 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxmsmpeg4v3videodec] ++type-name=GstOMXMSMPEG4V3Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.msmpeg4v3 + rank=257 + in-port-index=0 + out-port-index=1 +-hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxdivxvideodec] ++type-name=GstOMXDIVXDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.divx ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxxvidvideodec] ++type-name=GstOMXXVIDDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.xvid ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxflv1videodec] ++type-name=GstOMXFLV1Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.s263 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxrv20videodec] ++type-name=GstOMXRV20Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.rxg2 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxh263videodec] ++type-name=GstOMXH263Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.h263 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport + + [omxh264dec] + type-name=GstOMXH264Dec +-core-name=/usr/local/lib/libomxil-bellagio.so.0 +-component-name=OMX.st.video_decoder.avc ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.avc ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxwmv1videodec] ++type-name=GstOMXWMV1Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.wmv1 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxwmv2videodec] ++type-name=GstOMXWMV2Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.wmv2 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxvc1videodec] ++type-name=GstOMXWMVDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.vc1 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxvp6videodec] ++type-name=GstOMXVP6Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.vp6 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxvp8videodec] ++type-name=GstOMXVP8Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.vp8 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxvp9videodec] ++type-name=GstOMXVP9Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.vp9 + rank=257 + in-port-index=0 + out-port-index=1 +-hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxhevcvideodec] ++type-name=GstOMXH265Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.hevc ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxh264videoenc] ++type-name=GstOMXH264Enc ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.encoder.avc ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxh263videoenc] ++type-name=GstOMXH263Enc ++core-name=/usr/lib/libcdc_omxil_core.so ++component-name=OMX.allwinner.video.encoder.h263 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport + + [omxmpeg4videoenc] + type-name=GstOMXMPEG4VideoEnc +-core-name=/usr/local/lib/libomxil-bellagio.so.0 +-component-name=OMX.st.video_encoder.mpeg4 +-rank=0 ++core-name=/usr/lib/libcdc_omxil_core.so ++component-name=OMX.allwinner.video.encoder.mpeg4 ++rank=257 + in-port-index=0 + out-port-index=1 +-hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport + +-[omxaacenc] +-type-name=GstOMXAACEnc +-core-name=/usr/local/lib/libomxil-bellagio.so.0 +-component-name=OMX.st.audio_encoder.aac +-rank=0 ++[omxmjpegvideoenc] ++type-name=GstOMXMJPEGVideoEnc ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.encoder.mjpeg ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport ++ ++[omxrxvideodec] ++type-name=GstOMXRXDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.rx ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxdivx4videodec] ++type-name=GstOMXDIVX4Dec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.divx4 ++rank=257 ++in-port-index=0 ++out-port-index=1 ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport ++ ++[omxavsvideodec] ++type-name=GstOMXAVSDec ++core-name=/usr/lib/libOmxCore.so ++component-name=OMX.allwinner.video.decoder.avs ++rank=257 + in-port-index=0 + out-port-index=1 +-hacks=event-port-settings-changed-ndata-parameter-swap ++hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-changed-port-0-to-1;no-disable-outport +diff --git a/omx/Makefile.am b/omx/Makefile.am +index 9371e8b..ae9fc93 100644 +--- a/omx/Makefile.am ++++ b/omx/Makefile.am +@@ -35,7 +35,23 @@ libgstomx_la_SOURCES = \ + gstomxamrdec.c \ + gstomxaudiosink.c \ + gstomxanalogaudiosink.c \ +- gstomxhdmiaudiosink.c ++ gstomxhdmiaudiosink.c \ ++ gstomxdivxdec.c \ ++ gstomxxviddec.c \ ++ gstomxmsmpeg4v3dec.c \ ++ gstomxmsmpeg4v2dec.c \ ++ gstomxmsmpeg4v1dec.c \ ++ gstomxmpeg1dec.c \ ++ gstomxwmv1dec.c \ ++ gstomxwmv2dec.c \ ++ gstomxvp6dec.c \ ++ gstomxvp9dec.c \ ++ gstomxh265dec.c \ ++ gstomxflv1dec.c \ ++ gstomxrv20dec.c \ ++ gstomxdivx4dec.c \ ++ gstomxrxdec.c \ ++ gstomxavsdec.c + + noinst_HEADERS = \ + gstomx.h \ +@@ -62,7 +78,23 @@ noinst_HEADERS = \ + gstomxamrdec.h \ + gstomxaudiosink.h \ + gstomxanalogaudiosink.h \ +- gstomxhdmiaudiosink.h ++ gstomxhdmiaudiosink.h \ ++ gstomxdivxdec.h \ ++ gstomxxviddec.h \ ++ gstomxmsmpeg4v3dec.h \ ++ gstomxmsmpeg4v2dec.h \ ++ gstomxmsmpeg4v1dec.h \ ++ gstomxmpeg1dec.h \ ++ gstomxwmv1dec.h \ ++ gstomxwmv2dec.h \ ++ gstomxvp6dec.h \ ++ gstomxvp9dec.h \ ++ gstomxh264dec.h \ ++ gstomxflv1dec.h \ ++ gstomxrv20dec.h \ ++ gstomxdivx4dec.h \ ++ gstomxrxdec.h \ ++ gstomxavsdec.h + + if !HAVE_EXTERNAL_OMX + OMX_INCLUDEPATH = -I$(abs_srcdir)/openmax +diff --git a/omx/gstomx.c b/omx/gstomx.c +index f9b41eb..31c43e3 100644 +--- a/omx/gstomx.c ++++ b/omx/gstomx.c +@@ -45,6 +45,23 @@ + #include "gstomxamrdec.h" + #include "gstomxanalogaudiosink.h" + #include "gstomxhdmiaudiosink.h" ++#include "gstomxdivxdec.h" ++#include "gstomxxviddec.h" ++#include "gstomxmsmpeg4v3dec.h" ++#include "gstomxmsmpeg4v2dec.h" ++#include "gstomxmsmpeg4v1dec.h" ++#include "gstomxmpeg1dec.h" ++#include "gstomxwmv1dec.h" ++#include "gstomxwmv2dec.h" ++#include "gstomxvp6dec.h" ++#include "gstomxvp9dec.h" ++#include "gstomxh265dec.h" ++#include "gstomxflv1dec.h" ++#include "gstomxrv20dec.h" ++#include "gstomxdivx4dec.h" ++#include "gstomxrxdec.h" ++#include "gstomxavsdec.h" ++ + + GST_DEBUG_CATEGORY (gstomx_debug); + #define GST_CAT_DEFAULT gstomx_debug +@@ -2276,7 +2293,15 @@ static const GGetTypeFunction types[] = { + gst_omx_h264_enc_get_type, gst_omx_h263_enc_get_type, + gst_omx_aac_enc_get_type, gst_omx_mjpeg_dec_get_type, + gst_omx_aac_dec_get_type, gst_omx_mp3_dec_get_type, +- gst_omx_amr_dec_get_type ++ gst_omx_amr_dec_get_type, gst_omx_divx_dec_get_type, ++ gst_omx_xvid_dec_get_type, gst_omx_msmpeg4v3_dec_get_type, ++ gst_omx_msmpeg4v2_dec_get_type, gst_omx_msmpeg4v1_dec_get_type, ++ gst_omx_mpeg1_dec_get_type, gst_omx_wmv1_dec_get_type, ++ gst_omx_wmv2_dec_get_type, gst_omx_vp6_dec_get_type, ++ gst_omx_vp9_dec_get_type, gst_omx_h265_dec_get_type, ++ gst_omx_flv1_dec_get_type, gst_omx_rv20_dec_get_type, ++ gst_omx_rx_dec_get_type, gst_omx_divx4_dec_get_type, ++ gst_omx_avs_dec_get_type + #ifdef HAVE_VP8 + , gst_omx_vp8_dec_get_type + #endif +diff --git a/omx/gstomxavsdec.c b/omx/gstomxavsdec.c +new file mode 100644 +index 0000000..b442acb +--- /dev/null ++++ b/omx/gstomxavsdec.c +@@ -0,0 +1,98 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxavsdec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_avs_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_avs_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_avs_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_avs_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_avs_dec_debug_category, "omxavsdec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXAVSDec, gst_omx_avs_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_avs_dec_class_init (GstOMXAVSDecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_avs_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_avs_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-cavs, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX AVS Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode AVS video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.avs"); ++} ++ ++static void ++gst_omx_avs_dec_init (GstOMXAVSDec * self) ++{ ++} ++ ++static gboolean ++gst_omx_avs_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_avs_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingAVS; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxavsdec.h b/omx/gstomxavsdec.h +new file mode 100644 +index 0000000..add4391 +--- /dev/null ++++ b/omx/gstomxavsdec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_AVS_DEC_H__ ++#define __GST_OMX_AVS_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_AVS_DEC \ ++ (gst_omx_avs_dec_get_type()) ++#define GST_OMX_AVS_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_AVS_DEC,GstOMXAVSDec)) ++#define GST_OMX_AVS_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_AVS_DEC,GstOMXAVSDecClass)) ++#define GST_OMX_AVS_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_AVS_DEC,GstOMXAVSDecClass)) ++#define GST_IS_OMX_AVS_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_AVS_DEC)) ++#define GST_IS_OMX_AVS_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_AVS_DEC)) ++ ++typedef struct _GstOMXAVSDec GstOMXAVSDec; ++typedef struct _GstOMXAVSDecClass GstOMXAVSDecClass; ++ ++struct _GstOMXAVSDec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXAVSDecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_avs_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_AVS_DEC_H__ */ +diff --git a/omx/gstomxdivx4dec.c b/omx/gstomxdivx4dec.c +new file mode 100644 +index 0000000..aa3c534 +--- /dev/null ++++ b/omx/gstomxdivx4dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxdivx4dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_divx4_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_divx4_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_divx4_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_divx4_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_divx4_dec_debug_category, "omxdivx4dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXDIVX4Dec, gst_omx_divx4_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_divx4_dec_class_init (GstOMXDIVX4DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_divx4_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_divx4_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-divx, " ++ "divxversion=(int)4, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX DIVX4 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode DIVX4 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.divx4"); ++} ++ ++static void ++gst_omx_divx4_dec_init (GstOMXDIVX4Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_divx4_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_divx4_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingDIVX4; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxdivx4dec.h b/omx/gstomxdivx4dec.h +new file mode 100644 +index 0000000..9e296a6 +--- /dev/null ++++ b/omx/gstomxdivx4dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_DIVX4_DEC_H__ ++#define __GST_OMX_DIVX4_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_DIVX4_DEC \ ++ (gst_omx_divx4_dec_get_type()) ++#define GST_OMX_DIVX4_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_DIVX4_DEC,GstOMXDIVX4Dec)) ++#define GST_OMX_DIVX4_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_DIVX4_DEC,GstOMXDIVX4DecClass)) ++#define GST_OMX_DIVX4_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_DIVX4_DEC,GstOMXDIVX4DecClass)) ++#define GST_IS_OMX_DIVX4_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_DIVX4_DEC)) ++#define GST_IS_OMX_DIVX4_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_DIVX4_DEC)) ++ ++typedef struct _GstOMXDIVX4Dec GstOMXDIVX4Dec; ++typedef struct _GstOMXDIVX4DecClass GstOMXDIVX4DecClass; ++ ++struct _GstOMXDIVX4Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXDIVX4DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_divx4_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_DIVX4_DEC_H__ */ +diff --git a/omx/gstomxdivxdec.c b/omx/gstomxdivxdec.c +new file mode 100644 +index 0000000..d473c8e +--- /dev/null ++++ b/omx/gstomxdivxdec.c +@@ -0,0 +1,101 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++#include ++ ++#include "gstomxdivxdec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_divx_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_divx_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_divx_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_divx_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_divx_dec_debug_category, "omxdivxdec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXDIVXDec, gst_omx_divx_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_divx_dec_class_init (GstOMXDIVXDecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ printf("divx class init!\n"); ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_divx_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_divx_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-divx, " ++ "divxversion=(int)5, " ++ "parsed=(boolean) true, " "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX divx Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode divx video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.divx"); ++} ++ ++static void ++gst_omx_divx_dec_init (GstOMXDIVXDec * self) ++{ ++ printf("divx dec init!\n"); ++} ++ ++static gboolean ++gst_omx_divx_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_divx_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ printf("divx set format!\n"); ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingDIVX; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxdivxdec.h b/omx/gstomxdivxdec.h +new file mode 100644 +index 0000000..4e1c75a +--- /dev/null ++++ b/omx/gstomxdivxdec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_DIVX_DEC_H__ ++#define __GST_OMX_DIVX_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_DIVX_DEC \ ++ (gst_omx_divx_dec_get_type()) ++#define GST_OMX_DIVX_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_DIVX_DEC,GstOMXDIVXDec)) ++#define GST_OMX_DIVX_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_DIVX_DEC,GstOMXDIVXDecClass)) ++#define GST_OMX_DIVX_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_DIVX_DEC,GstOMXDIVXDecClass)) ++#define GST_IS_OMX_DIVX_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_DIVX_DEC)) ++#define GST_IS_OMX_DIVX_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_DIVX_DEC)) ++ ++typedef struct _GstOMXDIVXDec GstOMXDIVXDec; ++typedef struct _GstOMXDIVXDecClass GstOMXDIVXDecClass; ++ ++struct _GstOMXDIVXDec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXDIVXDecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_divx_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_DIVX_DEC_H__ */ +diff --git a/omx/gstomxflv1dec.c b/omx/gstomxflv1dec.c +new file mode 100644 +index 0000000..fb9a258 +--- /dev/null ++++ b/omx/gstomxflv1dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxflv1dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_flv1_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_flv1_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_flv1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_flv1_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_flv1_dec_debug_category, "omxflv1dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXFLV1Dec, gst_omx_flv1_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_flv1_dec_class_init (GstOMXFLV1DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_flv1_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_flv1_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-flash-video, " ++ "flvversion=(int)1, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX FLV1 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode FLV1 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.flv1"); ++} ++ ++static void ++gst_omx_flv1_dec_init (GstOMXFLV1Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_flv1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_flv1_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingS263; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxflv1dec.h b/omx/gstomxflv1dec.h +new file mode 100644 +index 0000000..91f7d55 +--- /dev/null ++++ b/omx/gstomxflv1dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_FLV1_DEC_H__ ++#define __GST_OMX_FLV1_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_FLV1_DEC \ ++ (gst_omx_flv1_dec_get_type()) ++#define GST_OMX_FLV1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_FLV1_DEC,GstOMXFLV1Dec)) ++#define GST_OMX_FLV1_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_FLV1_DEC,GstOMXFLV1DecClass)) ++#define GST_OMX_FLV1_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_FLV1_DEC,GstOMXFLV1DecClass)) ++#define GST_IS_OMX_FLV1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_FLV1_DEC)) ++#define GST_IS_OMX_FLV1_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_FLV1_DEC)) ++ ++typedef struct _GstOMXFLV1Dec GstOMXFLV1Dec; ++typedef struct _GstOMXFLV1DecClass GstOMXFLV1DecClass; ++ ++struct _GstOMXFLV1Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXFLV1DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_flv1_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_FLV1_DEC_H__ */ +diff --git a/omx/gstomxh265dec.c b/omx/gstomxh265dec.c +new file mode 100644 +index 0000000..0a64c81 +--- /dev/null ++++ b/omx/gstomxh265dec.c +@@ -0,0 +1,98 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxh265dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_h265_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_h265_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_h265_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_h265_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_h265_dec_debug_category, "omxh265dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXH265Dec, gst_omx_h265_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_h265_dec_class_init (GstOMXH265DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_h265_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_h265_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-h265, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX H265 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode H265 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.h265"); ++} ++ ++static void ++gst_omx_h265_dec_init (GstOMXH265Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_h265_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_h265_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingHEVC; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxh265dec.h b/omx/gstomxh265dec.h +new file mode 100644 +index 0000000..8afeafe +--- /dev/null ++++ b/omx/gstomxh265dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_H265_DEC_H__ ++#define __GST_OMX_H265_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_H265_DEC \ ++ (gst_omx_h265_dec_get_type()) ++#define GST_OMX_H265_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_H265_DEC,GstOMXH265Dec)) ++#define GST_OMX_H265_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_H265_DEC,GstOMXH265DecClass)) ++#define GST_OMX_H265_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_H265_DEC,GstOMXH265DecClass)) ++#define GST_IS_OMX_H265_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_H265_DEC)) ++#define GST_IS_OMX_H265_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_H265_DEC)) ++ ++typedef struct _GstOMXH265Dec GstOMXH265Dec; ++typedef struct _GstOMXH265DecClass GstOMXH265DecClass; ++ ++struct _GstOMXH265Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXH265DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_h265_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_H265_DEC_H__ */ +diff --git a/omx/gstomxmpeg1dec.c b/omx/gstomxmpeg1dec.c +new file mode 100644 +index 0000000..62238a8 +--- /dev/null ++++ b/omx/gstomxmpeg1dec.c +@@ -0,0 +1,100 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxmpeg1dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_mpeg1_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_mpeg1_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_mpeg1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_mpeg1_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_mpeg1_dec_debug_category, "omxmpeg1dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXMPEG1Dec, gst_omx_mpeg1_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_mpeg1_dec_class_init (GstOMXMPEG1DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_mpeg1_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_mpeg1_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/mpeg, " ++ "mpegversion=(int)1, " ++ "systemstream=(boolean) false, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX MPEG1 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode MPEG1 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.mpeg1"); ++} ++ ++static void ++gst_omx_mpeg1_dec_init (GstOMXMPEG1Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_mpeg1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_mpeg1_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMPEG1; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxmpeg1dec.h b/omx/gstomxmpeg1dec.h +new file mode 100644 +index 0000000..097e4f6 +--- /dev/null ++++ b/omx/gstomxmpeg1dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_MPEG1_DEC_H__ ++#define __GST_OMX_MPEG1_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_MPEG1_DEC \ ++ (gst_omx_mpeg1_dec_get_type()) ++#define GST_OMX_MPEG1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MPEG1_DEC,GstOMXMPEG1Dec)) ++#define GST_OMX_MPEG1_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_MPEG1_DEC,GstOMXMPEG1DecClass)) ++#define GST_OMX_MPEG1_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_MPEG1_DEC,GstOMXMPEG1DecClass)) ++#define GST_IS_OMX_MPEG1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_MPEG1_DEC)) ++#define GST_IS_OMX_MPEG1_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_MPEG1_DEC)) ++ ++typedef struct _GstOMXMPEG1Dec GstOMXMPEG1Dec; ++typedef struct _GstOMXMPEG1DecClass GstOMXMPEG1DecClass; ++ ++struct _GstOMXMPEG1Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXMPEG1DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_mpeg1_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_MPEG1_DEC_H__ */ +diff --git a/omx/gstomxmpeg2videodec.c b/omx/gstomxmpeg2videodec.c +index 7eaaf8b..80ab4b7 100644 +--- a/omx/gstomxmpeg2videodec.c ++++ b/omx/gstomxmpeg2videodec.c +@@ -61,7 +61,7 @@ gst_omx_mpeg2_video_dec_class_init (GstOMXMPEG2VideoDecClass * klass) + GST_DEBUG_FUNCPTR (gst_omx_mpeg2_video_dec_set_format); + + videodec_class->cdata.default_sink_template_caps = "video/mpeg, " +- "mpegversion=(int) [1, 2], " ++ "mpegversion=(int)2, " + "systemstream=(boolean) false, " + "parsed=(boolean) true, " "width=(int) [1,MAX], " "height=(int) [1,MAX]"; + +diff --git a/omx/gstomxmpeg4videodec.c b/omx/gstomxmpeg4videodec.c +index d912d74..51cd3aa 100644 +--- a/omx/gstomxmpeg4videodec.c ++++ b/omx/gstomxmpeg4videodec.c +@@ -23,6 +23,7 @@ + #endif + + #include ++#include + + #include "gstomxmpeg4videodec.h" + +@@ -55,7 +56,7 @@ gst_omx_mpeg4_video_dec_class_init (GstOMXMPEG4VideoDecClass * klass) + { + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); +- ++ printf("mpeg4 class init!\n"); + videodec_class->is_format_change = + GST_DEBUG_FUNCPTR (gst_omx_mpeg4_video_dec_is_format_change); + videodec_class->set_format = +@@ -78,12 +79,14 @@ gst_omx_mpeg4_video_dec_class_init (GstOMXMPEG4VideoDecClass * klass) + static void + gst_omx_mpeg4_video_dec_init (GstOMXMPEG4VideoDec * self) + { ++ printf("mpeg4 dec init!\n"); + } + + static gboolean + gst_omx_mpeg4_video_dec_is_format_change (GstOMXVideoDec * dec, + GstOMXPort * port, GstVideoCodecState * state) + { ++ printf("mpeg4 video format change!\n"); + return FALSE; + } + +@@ -93,7 +96,7 @@ gst_omx_mpeg4_video_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, + { + gboolean ret; + OMX_PARAM_PORTDEFINITIONTYPE port_def; +- ++ printf("mpeg4 video set format!\n"); + gst_omx_port_get_port_definition (port, &port_def); + port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMPEG4; + ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; +diff --git a/omx/gstomxmsmpeg4v1dec.c b/omx/gstomxmsmpeg4v1dec.c +new file mode 100644 +index 0000000..4da7b5d +--- /dev/null ++++ b/omx/gstomxmsmpeg4v1dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxmsmpeg4v1dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_msmpeg4v1_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_msmpeg4v1_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_msmpeg4v1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_msmpeg4v1_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_msmpeg4v1_dec_debug_category, "omxmsmpeg4v1dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXMSMPEG4V1Dec, gst_omx_msmpeg4v1_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_msmpeg4v1_dec_class_init (GstOMXMSMPEG4V1DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_msmpeg4v1_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_msmpeg4v1_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-msmpeg, " ++ "msmpegversion=(int)41, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX MSMPEG4V1 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode MSMPEG4V1 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.msmpeg4v1"); ++} ++ ++static void ++gst_omx_msmpeg4v1_dec_init (GstOMXMSMPEG4V1Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_msmpeg4v1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_msmpeg4v1_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMSMPEG4V1; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxmsmpeg4v1dec.h b/omx/gstomxmsmpeg4v1dec.h +new file mode 100644 +index 0000000..902eb13 +--- /dev/null ++++ b/omx/gstomxmsmpeg4v1dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_MSMPEG4V1_DEC_H__ ++#define __GST_OMX_MSMPEG4V1_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_MSMPEG4V1_DEC \ ++ (gst_omx_msmpeg4v1_dec_get_type()) ++#define GST_OMX_MSMPEG4V1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MSMPEG4V1_DEC,GstOMXMSMPEG4V1Dec)) ++#define GST_OMX_MSMPEG4V1_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_MSMPEG4V1_DEC,GstOMXMSMPEG4V1DecClass)) ++#define GST_OMX_MSMPEG4V1_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_MSMPEG4V1_DEC,GstOMXMSMPEG4V1DecClass)) ++#define GST_IS_OMX_MSMPEG4V1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_MSMPEG4V1_DEC)) ++#define GST_IS_OMX_MSMPEG4V1_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_MSMPEG4V1_DEC)) ++ ++typedef struct _GstOMXMSMPEG4V1Dec GstOMXMSMPEG4V1Dec; ++typedef struct _GstOMXMSMPEG4V1DecClass GstOMXMSMPEG4V1DecClass; ++ ++struct _GstOMXMSMPEG4V1Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXMSMPEG4V1DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_msmpeg4v1_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_MSMPEG4V1_DEC_H__ */ +diff --git a/omx/gstomxmsmpeg4v2dec.c b/omx/gstomxmsmpeg4v2dec.c +new file mode 100644 +index 0000000..00e9cb6 +--- /dev/null ++++ b/omx/gstomxmsmpeg4v2dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxmsmpeg4v2dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_msmpeg4v2_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_msmpeg4v2_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_msmpeg4v2_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_msmpeg4v2_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_msmpeg4v2_dec_debug_category, "omxmsmpeg4v2dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXMSMPEG4V2Dec, gst_omx_msmpeg4v2_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_msmpeg4v2_dec_class_init (GstOMXMSMPEG4V2DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_msmpeg4v2_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_msmpeg4v2_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-msmpeg, " ++ "msmpegversion=(int)42, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX MSMPEG4V2 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode MSMPEG4V2 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.msmpeg4v2"); ++} ++ ++static void ++gst_omx_msmpeg4v2_dec_init (GstOMXMSMPEG4V2Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_msmpeg4v2_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_msmpeg4v2_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMSMPEG4V2; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxmsmpeg4v2dec.h b/omx/gstomxmsmpeg4v2dec.h +new file mode 100644 +index 0000000..45122e4 +--- /dev/null ++++ b/omx/gstomxmsmpeg4v2dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_MSMPEG4V2_DEC_H__ ++#define __GST_OMX_MSMPEG4V2_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_MSMPEG4V2_DEC \ ++ (gst_omx_msmpeg4v2_dec_get_type()) ++#define GST_OMX_MSMPEG4V2_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MSMPEG4V2_DEC,GstOMXMSMPEG4V2Dec)) ++#define GST_OMX_MSMPEG4V2_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_MSMPEG4V2_DEC,GstOMXMSMPEG4V2DecClass)) ++#define GST_OMX_MSMPEG4V2_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_MSMPEG4V2_DEC,GstOMXMSMPEG4V2DecClass)) ++#define GST_IS_OMX_MSMPEG4V2_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_MSMPEG4V2_DEC)) ++#define GST_IS_OMX_MSMPEG4V2_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_MSMPEG4V2_DEC)) ++ ++typedef struct _GstOMXMSMPEG4V2Dec GstOMXMSMPEG4V2Dec; ++typedef struct _GstOMXMSMPEG4V2DecClass GstOMXMSMPEG4V2DecClass; ++ ++struct _GstOMXMSMPEG4V2Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXMSMPEG4V2DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_msmpeg4v2_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_MSMPEG4V2_DEC_H__ */ +diff --git a/omx/gstomxmsmpeg4v3dec.c b/omx/gstomxmsmpeg4v3dec.c +new file mode 100644 +index 0000000..0b73e92 +--- /dev/null ++++ b/omx/gstomxmsmpeg4v3dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxmsmpeg4v3dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_msmpeg4v3_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_msmpeg4v3_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_msmpeg4v3_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_msmpeg4v3_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_msmpeg4v3_dec_debug_category, "omxmsmpeg4v3dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXMSMPEG4V3Dec, gst_omx_msmpeg4v3_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_msmpeg4v3_dec_class_init (GstOMXMSMPEG4V3DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_msmpeg4v3_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_msmpeg4v3_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-msmpeg, " ++ "msmpegversion=(int)43, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX MSMPEG4V3 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode MSMPEG4V3 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.msmpeg4v3"); ++} ++ ++static void ++gst_omx_msmpeg4v3_dec_init (GstOMXMSMPEG4V3Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_msmpeg4v3_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_msmpeg4v3_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMSMPEG4V3; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxmsmpeg4v3dec.h b/omx/gstomxmsmpeg4v3dec.h +new file mode 100644 +index 0000000..626fc89 +--- /dev/null ++++ b/omx/gstomxmsmpeg4v3dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_MSMPEG4V3_DEC_H__ ++#define __GST_OMX_MSMPEG4V3_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_MSMPEG4V3_DEC \ ++ (gst_omx_msmpeg4v3_dec_get_type()) ++#define GST_OMX_MSMPEG4V3_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MSMPEG4V3_DEC,GstOMXMSMPEG4V3Dec)) ++#define GST_OMX_MSMPEG4V3_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_MSMPEG4V3_DEC,GstOMXMSMPEG4V3DecClass)) ++#define GST_OMX_MSMPEG4V3_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_MSMPEG4V3_DEC,GstOMXMSMPEG4V3DecClass)) ++#define GST_IS_OMX_MSMPEG4V3_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_MSMPEG4V3_DEC)) ++#define GST_IS_OMX_MSMPEG4V3_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_MSMPEG4V3_DEC)) ++ ++typedef struct _GstOMXMSMPEG4V3Dec GstOMXMSMPEG4V3Dec; ++typedef struct _GstOMXMSMPEG4V3DecClass GstOMXMSMPEG4V3DecClass; ++ ++struct _GstOMXMSMPEG4V3Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXMSMPEG4V3DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_msmpeg4v3_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_MSMPEG4V3_DEC_H__ */ +diff --git a/omx/gstomxrv20dec.c b/omx/gstomxrv20dec.c +new file mode 100644 +index 0000000..c869b79 +--- /dev/null ++++ b/omx/gstomxrv20dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxrv20dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_rv20_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_rv20_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_rv20_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_rv20_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_rv20_dec_debug_category, "omxrv20dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXRV20Dec, gst_omx_rv20_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_rv20_dec_class_init (GstOMXRV20DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_rv20_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_rv20_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-pn-realvideo, " ++ "rmversion=(int)[1,2], " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX RV20 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode RV20 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.rv20"); ++} ++ ++static void ++gst_omx_rv20_dec_init (GstOMXRV20Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_rv20_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_rv20_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingRXG2; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxrv20dec.h b/omx/gstomxrv20dec.h +new file mode 100644 +index 0000000..43d0373 +--- /dev/null ++++ b/omx/gstomxrv20dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_RV20_DEC_H__ ++#define __GST_OMX_RV20_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_RV20_DEC \ ++ (gst_omx_rv20_dec_get_type()) ++#define GST_OMX_RV20_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_RV20_DEC,GstOMXRV20Dec)) ++#define GST_OMX_RV20_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_RV20_DEC,GstOMXRV20DecClass)) ++#define GST_OMX_RV20_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_RV20_DEC,GstOMXRV20DecClass)) ++#define GST_IS_OMX_RV20_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_RV20_DEC)) ++#define GST_IS_OMX_RV20_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_RV20_DEC)) ++ ++typedef struct _GstOMXRV20Dec GstOMXRV20Dec; ++typedef struct _GstOMXRV20DecClass GstOMXRV20DecClass; ++ ++struct _GstOMXRV20Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXRV20DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_rv20_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_RV20_DEC_H__ */ +diff --git a/omx/gstomxrxdec.c b/omx/gstomxrxdec.c +new file mode 100644 +index 0000000..c613f27 +--- /dev/null ++++ b/omx/gstomxrxdec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxrxdec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_rx_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_rx_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_rx_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_rx_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_rx_dec_debug_category, "omxrxdec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXRXDec, gst_omx_rx_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_rx_dec_class_init (GstOMXRXDecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_rx_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_rx_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-pn-realvideo, " ++ "rmversion=(int)[3,4], " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX RX Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode RX video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.rx"); ++} ++ ++static void ++gst_omx_rx_dec_init (GstOMXRXDec * self) ++{ ++} ++ ++static gboolean ++gst_omx_rx_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_rx_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingRX; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxrxdec.h b/omx/gstomxrxdec.h +new file mode 100644 +index 0000000..3995117 +--- /dev/null ++++ b/omx/gstomxrxdec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_RX_DEC_H__ ++#define __GST_OMX_RX_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_RX_DEC \ ++ (gst_omx_rx_dec_get_type()) ++#define GST_OMX_RX_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_RX_DEC,GstOMXRXDec)) ++#define GST_OMX_RX_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_RX_DEC,GstOMXRXDecClass)) ++#define GST_OMX_RX_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_RX_DEC,GstOMXRXDecClass)) ++#define GST_IS_OMX_RX_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_RX_DEC)) ++#define GST_IS_OMX_RX_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_RX_DEC)) ++ ++typedef struct _GstOMXRXDec GstOMXRXDec; ++typedef struct _GstOMXRXDecClass GstOMXRXDecClass; ++ ++struct _GstOMXRXDec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXRXDecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_rx_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_RX_DEC_H__ */ +diff --git a/omx/gstomxvp6dec.c b/omx/gstomxvp6dec.c +new file mode 100644 +index 0000000..e7c8ce0 +--- /dev/null ++++ b/omx/gstomxvp6dec.c +@@ -0,0 +1,98 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxvp6dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_vp6_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_vp6_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_vp6_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_vp6_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_vp6_dec_debug_category, "omxvp6dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXVP6Dec, gst_omx_vp6_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_vp6_dec_class_init (GstOMXVP6DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_vp6_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_vp6_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-vp6, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX VP6 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode VP6 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.vp6"); ++} ++ ++static void ++gst_omx_vp6_dec_init (GstOMXVP6Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_vp6_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_vp6_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingVP6; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxvp6dec.h b/omx/gstomxvp6dec.h +new file mode 100644 +index 0000000..6ba814a +--- /dev/null ++++ b/omx/gstomxvp6dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_VP6_DEC_H__ ++#define __GST_OMX_VP6_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_VP6_DEC \ ++ (gst_omx_vp6_dec_get_type()) ++#define GST_OMX_VP6_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VP6_DEC,GstOMXVP6Dec)) ++#define GST_OMX_VP6_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VP6_DEC,GstOMXVP6DecClass)) ++#define GST_OMX_VP6_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VP6_DEC,GstOMXVP6DecClass)) ++#define GST_IS_OMX_VP6_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VP6_DEC)) ++#define GST_IS_OMX_VP6_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VP6_DEC)) ++ ++typedef struct _GstOMXVP6Dec GstOMXVP6Dec; ++typedef struct _GstOMXVP6DecClass GstOMXVP6DecClass; ++ ++struct _GstOMXVP6Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXVP6DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_vp6_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_VP6_DEC_H__ */ +diff --git a/omx/gstomxvp9dec.c b/omx/gstomxvp9dec.c +new file mode 100644 +index 0000000..7203738 +--- /dev/null ++++ b/omx/gstomxvp9dec.c +@@ -0,0 +1,98 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxvp9dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_vp9_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_vp9_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_vp9_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_vp9_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_vp9_dec_debug_category, "omxvp9dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXVP9Dec, gst_omx_vp9_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_vp9_dec_class_init (GstOMXVP9DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_vp9_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_vp9_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-vp9, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX VP9 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode VP9 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.vp9"); ++} ++ ++static void ++gst_omx_vp9_dec_init (GstOMXVP9Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_vp9_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_vp9_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingVP9; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxvp9dec.h b/omx/gstomxvp9dec.h +new file mode 100644 +index 0000000..6727cb5 +--- /dev/null ++++ b/omx/gstomxvp9dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_VP9_DEC_H__ ++#define __GST_OMX_VP9_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_VP9_DEC \ ++ (gst_omx_vp9_dec_get_type()) ++#define GST_OMX_VP9_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VP9_DEC,GstOMXVP9Dec)) ++#define GST_OMX_VP9_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VP9_DEC,GstOMXVP9DecClass)) ++#define GST_OMX_VP9_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VP9_DEC,GstOMXVP9DecClass)) ++#define GST_IS_OMX_VP9_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VP9_DEC)) ++#define GST_IS_OMX_VP9_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VP9_DEC)) ++ ++typedef struct _GstOMXVP9Dec GstOMXVP9Dec; ++typedef struct _GstOMXVP9DecClass GstOMXVP9DecClass; ++ ++struct _GstOMXVP9Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXVP9DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_vp9_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_VP9_DEC_H__ */ +diff --git a/omx/gstomxwmv1dec.c b/omx/gstomxwmv1dec.c +new file mode 100644 +index 0000000..4cf3460 +--- /dev/null ++++ b/omx/gstomxwmv1dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxwmv1dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_wmv1_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_wmv1_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_wmv1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_wmv1_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_wmv1_dec_debug_category, "omxwmv1dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXWMV1Dec, gst_omx_wmv1_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_wmv1_dec_class_init (GstOMXWMV1DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_wmv1_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_wmv1_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-wmv, " ++ "wmvversion=(int)1, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX WMV1 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode WMV1 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.wmv1"); ++} ++ ++static void ++gst_omx_wmv1_dec_init (GstOMXWMV1Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_wmv1_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_wmv1_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingWMV1; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxwmv1dec.h b/omx/gstomxwmv1dec.h +new file mode 100644 +index 0000000..331df84 +--- /dev/null ++++ b/omx/gstomxwmv1dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_WMV1_DEC_H__ ++#define __GST_OMX_WMV1_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_WMV1_DEC \ ++ (gst_omx_wmv1_dec_get_type()) ++#define GST_OMX_WMV1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_WMV1_DEC,GstOMXWMV1Dec)) ++#define GST_OMX_WMV1_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_WMV1_DEC,GstOMXWMV1DecClass)) ++#define GST_OMX_WMV1_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_WMV1_DEC,GstOMXWMV1DecClass)) ++#define GST_IS_OMX_WMV1_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_WMV1_DEC)) ++#define GST_IS_OMX_WMV1_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_WMV1_DEC)) ++ ++typedef struct _GstOMXWMV1Dec GstOMXWMV1Dec; ++typedef struct _GstOMXWMV1DecClass GstOMXWMV1DecClass; ++ ++struct _GstOMXWMV1Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXWMV1DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_wmv1_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_WMV1_DEC_H__ */ +diff --git a/omx/gstomxwmv2dec.c b/omx/gstomxwmv2dec.c +new file mode 100644 +index 0000000..7691a15 +--- /dev/null ++++ b/omx/gstomxwmv2dec.c +@@ -0,0 +1,99 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxwmv2dec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_wmv2_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_wmv2_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_wmv2_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_wmv2_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_wmv2_dec_debug_category, "omxwmv2dec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXWMV2Dec, gst_omx_wmv2_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_wmv2_dec_class_init (GstOMXWMV2DecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_wmv2_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_wmv2_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-wmv, " ++ "wmvversion=(int)2, " ++ "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX WMV2 Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode WMV2 video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.wmv2"); ++} ++ ++static void ++gst_omx_wmv2_dec_init (GstOMXWMV2Dec * self) ++{ ++} ++ ++static gboolean ++gst_omx_wmv2_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_wmv2_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingWMV2; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxwmv2dec.h b/omx/gstomxwmv2dec.h +new file mode 100644 +index 0000000..53b36b6 +--- /dev/null ++++ b/omx/gstomxwmv2dec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_WMV2_DEC_H__ ++#define __GST_OMX_WMV2_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_WMV2_DEC \ ++ (gst_omx_wmv2_dec_get_type()) ++#define GST_OMX_WMV2_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_WMV2_DEC,GstOMXWMV2Dec)) ++#define GST_OMX_WMV2_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_WMV2_DEC,GstOMXWMV2DecClass)) ++#define GST_OMX_WMV2_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_WMV2_DEC,GstOMXWMV2DecClass)) ++#define GST_IS_OMX_WMV2_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_WMV2_DEC)) ++#define GST_IS_OMX_WMV2_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_WMV2_DEC)) ++ ++typedef struct _GstOMXWMV2Dec GstOMXWMV2Dec; ++typedef struct _GstOMXWMV2DecClass GstOMXWMV2DecClass; ++ ++struct _GstOMXWMV2Dec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXWMV2DecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_wmv2_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_WMV2_DEC_H__ */ +diff --git a/omx/gstomxxviddec.c b/omx/gstomxxviddec.c +new file mode 100644 +index 0000000..68d3134 +--- /dev/null ++++ b/omx/gstomxxviddec.c +@@ -0,0 +1,98 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxxviddec.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_xvid_dec_debug_category); ++#define GST_CAT_DEFAULT gst_omx_xvid_dec_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_xvid_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++static gboolean gst_omx_xvid_dec_set_format (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_xvid_dec_debug_category, "omxxviddec", 0, \ ++ "debug category for gst-omx video decoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXXVIDDec, gst_omx_xvid_dec, ++ GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT); ++ ++static void ++gst_omx_xvid_dec_class_init (GstOMXXVIDDecClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass); ++ ++ videodec_class->is_format_change = ++ GST_DEBUG_FUNCPTR (gst_omx_xvid_dec_is_format_change); ++ videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_xvid_dec_set_format); ++ ++ videodec_class->cdata.default_sink_template_caps = "video/x-xvid, " ++ "parsed=(boolean) true, " "width=(int) [1,MAX], " "height=(int) [1,MAX]"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX XVID Video Decoder", ++ "Codec/Decoder/Video", ++ "Decode XVID video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.xvid"); ++} ++ ++static void ++gst_omx_xvid_dec_init (GstOMXXVIDDec * self) ++{ ++} ++ ++static gboolean ++gst_omx_xvid_dec_is_format_change (GstOMXVideoDec * dec, ++ GstOMXPort * port, GstVideoCodecState * state) ++{ ++ return FALSE; ++} ++ ++static gboolean ++gst_omx_xvid_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ gboolean ret; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ ++ gst_omx_port_get_port_definition (port, &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingXVID; ++ ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone; ++ ++ return ret; ++} +diff --git a/omx/gstomxxviddec.h b/omx/gstomxxviddec.h +new file mode 100644 +index 0000000..d9a6542 +--- /dev/null ++++ b/omx/gstomxxviddec.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_XVID_DEC_H__ ++#define __GST_OMX_XVID_DEC_H__ ++ ++#include ++#include "gstomxvideodec.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_XVID_DEC \ ++ (gst_omx_xvid_dec_get_type()) ++#define GST_OMX_XVID_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_XVID_DEC,GstOMXXVIDDec)) ++#define GST_OMX_XVID_DEC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_XVID_DEC,GstOMXXVIDDecClass)) ++#define GST_OMX_XVID_DEC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_XVID_DEC,GstOMXXVIDDecClass)) ++#define GST_IS_OMX_XVID_DEC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_XVID_DEC)) ++#define GST_IS_OMX_XVID_DEC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_XVID_DEC)) ++ ++typedef struct _GstOMXXVIDDec GstOMXXVIDDec; ++typedef struct _GstOMXXVIDDecClass GstOMXXVIDDecClass; ++ ++struct _GstOMXXVIDDec ++{ ++ GstOMXVideoDec parent; ++}; ++ ++struct _GstOMXXVIDDecClass ++{ ++ GstOMXVideoDecClass parent_class; ++}; ++ ++GType gst_omx_xvid_dec_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_XVID_DEC_H__ */ +diff --git a/omx/openmax/OMX_Video.h b/omx/openmax/OMX_Video.h +index 163e450..f85ca83 100644 +--- a/omx/openmax/OMX_Video.h ++++ b/omx/openmax/OMX_Video.h +@@ -68,8 +68,27 @@ typedef enum OMX_VIDEO_CODINGTYPE { + OMX_VIDEO_CodingRV, /**< all versions of Real Video */ + OMX_VIDEO_CodingAVC, /**< H.264/AVC */ + OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ ++ OMX_VIDEO_CodingVP8, ++ OMX_VIDEO_CodingVP9, /**< Google VP9 */ ++ OMX_VIDEO_CodingHEVC, /**< ITU H.265/HEVC */ + OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ ++ //*add by xiwang ++ OMX_VIDEO_CodingVP6, ++ OMX_VIDEO_CodingMPEG1, ++ OMX_VIDEO_CodingS263, ++ OMX_VIDEO_CodingMSMPEG4V1, ++ OMX_VIDEO_CodingMSMPEG4V2, ++ OMX_VIDEO_CodingDIVX, ++ OMX_VIDEO_CodingXVID, ++ OMX_VIDEO_CodingRXG2, ++ OMX_VIDEO_CodingWMV1, ++ OMX_VIDEO_CodingWMV2, ++ OMX_VIDEO_CodingMSMPEG4V3, ++ OMX_VIDEO_CodingDIVX4, ++ OMX_VIDEO_CodingRX, ++ OMX_VIDEO_CodingAVS, ++ //*end + OMX_VIDEO_CodingMax = 0x7FFFFFFF + } OMX_VIDEO_CODINGTYPE; + +@@ -798,6 +817,7 @@ typedef enum OMX_VIDEO_AVCLEVELTYPE { + OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ + OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ + OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ ++ OMX_VIDEO_AVCLevel52 = 0x10000, /**< Level 5.2 */ + OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ + OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF +-- +2.7.4 + diff --git a/board/miyoo/patches/gst-omx/0002-add-mjpeg-encoder-and-remove-h263-and-mpeg4.patch b/board/miyoo/patches/gst-omx/0002-add-mjpeg-encoder-and-remove-h263-and-mpeg4.patch new file mode 100755 index 00000000..53a26650 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0002-add-mjpeg-encoder-and-remove-h263-and-mpeg4.patch @@ -0,0 +1,340 @@ +From 863e52e8f34c2c23c3411272734c7bed28c2d5fc Mon Sep 17 00:00:00 2001 +From: xiebin +Date: Thu, 1 Jun 2017 17:04:53 +0800 +Subject: [PATCH 2/2] add mjpeg and remove h263 and mpeg4 encoder + +--- + config/bellagio/gstomx.conf | 20 +---- + omx/Makefile.am | 6 +- + omx/gstomx.c | 3 +- + omx/gstomxmjpegenc.c | 174 ++++++++++++++++++++++++++++++++++++++++++++ + omx/gstomxmjpegenc.h | 59 +++++++++++++++ + 5 files changed, 240 insertions(+), 22 deletions(-) + create mode 100644 omx/gstomxmjpegenc.c + create mode 100644 omx/gstomxmjpegenc.h + +diff --git a/config/bellagio/gstomx.conf b/config/bellagio/gstomx.conf +index cf27588..8aaa01a 100644 +--- a/config/bellagio/gstomx.conf ++++ b/config/bellagio/gstomx.conf +@@ -187,26 +187,8 @@ in-port-index=0 + out-port-index=1 + hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport + +-[omxh263videoenc] +-type-name=GstOMXH263Enc +-core-name=/usr/lib/libcdc_omxil_core.so +-component-name=OMX.allwinner.video.encoder.h263 +-rank=257 +-in-port-index=0 +-out-port-index=1 +-hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport +- +-[omxmpeg4videoenc] +-type-name=GstOMXMPEG4VideoEnc +-core-name=/usr/lib/libcdc_omxil_core.so +-component-name=OMX.allwinner.video.encoder.mpeg4 +-rank=257 +-in-port-index=0 +-out-port-index=1 +-hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;syncframe-flag-not-used;no-disable-outport +- + [omxmjpegvideoenc] +-type-name=GstOMXMJPEGVideoEnc ++type-name=GstOMXMJPEGEnc + core-name=/usr/lib/libOmxCore.so + component-name=OMX.allwinner.video.encoder.mjpeg + rank=257 +diff --git a/omx/Makefile.am b/omx/Makefile.am +index b3627f7..f7596dd 100644 +--- a/omx/Makefile.am ++++ b/omx/Makefile.am +@@ -51,7 +51,8 @@ libgstomx_la_SOURCES = \ + gstomxrv20dec.c \ + gstomxdivx4dec.c \ + gstomxrxdec.c \ +- gstomxavsdec.c ++ gstomxavsdec.c \ ++ gstomxmjpegenc.c + + noinst_HEADERS = \ + gstomx.h \ +@@ -94,7 +95,8 @@ noinst_HEADERS = \ + gstomxrv20dec.h \ + gstomxdivx4dec.h \ + gstomxrxdec.h \ +- gstomxavsdec.h ++ gstomxavsdec.h \ ++ gstomxmjpegenc.h + + if !HAVE_EXTERNAL_OMX + OMX_INCLUDEPATH = -I$(abs_srcdir)/openmax +diff --git a/omx/gstomx.c b/omx/gstomx.c +index 31c43e3..175b350 100644 +--- a/omx/gstomx.c ++++ b/omx/gstomx.c +@@ -61,6 +61,7 @@ + #include "gstomxdivx4dec.h" + #include "gstomxrxdec.h" + #include "gstomxavsdec.h" ++#include "gstomxmjpegenc.h" + + + GST_DEBUG_CATEGORY (gstomx_debug); +@@ -2301,7 +2302,7 @@ static const GGetTypeFunction types[] = { + gst_omx_vp9_dec_get_type, gst_omx_h265_dec_get_type, + gst_omx_flv1_dec_get_type, gst_omx_rv20_dec_get_type, + gst_omx_rx_dec_get_type, gst_omx_divx4_dec_get_type, +- gst_omx_avs_dec_get_type ++ gst_omx_avs_dec_get_type, gst_omx_mjpeg_enc_get_type + #ifdef HAVE_VP8 + , gst_omx_vp8_dec_get_type + #endif +diff --git a/omx/gstomxmjpegenc.c b/omx/gstomxmjpegenc.c +new file mode 100644 +index 0000000..ed2234e +--- /dev/null ++++ b/omx/gstomxmjpegenc.c +@@ -0,0 +1,174 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++ ++#include "gstomxmjpegenc.h" ++ ++GST_DEBUG_CATEGORY_STATIC (gst_omx_mjpeg_enc_debug_category); ++#define GST_CAT_DEFAULT gst_omx_mjpeg_enc_debug_category ++ ++/* prototypes */ ++static gboolean gst_omx_mjpeg_enc_set_format (GstOMXVideoEnc * enc, ++ GstOMXPort * port, GstVideoCodecState * state); ++static GstCaps *gst_omx_mjpeg_enc_get_caps (GstOMXVideoEnc * enc, ++ GstOMXPort * port, GstVideoCodecState * state); ++ ++enum ++{ ++ PROP_0 ++}; ++ ++/* class initialization */ ++ ++#define DEBUG_INIT \ ++ GST_DEBUG_CATEGORY_INIT (gst_omx_mjpeg_enc_debug_category, "omxmjpegenc", 0, \ ++ "debug category for gst-omx video encoder base class"); ++ ++G_DEFINE_TYPE_WITH_CODE (GstOMXMJPEGEnc, gst_omx_mjpeg_enc, ++ GST_TYPE_OMX_VIDEO_ENC, DEBUG_INIT); ++ ++static void ++gst_omx_mjpeg_enc_class_init (GstOMXMJPEGEncClass * klass) ++{ ++ GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GstOMXVideoEncClass *videoenc_class = GST_OMX_VIDEO_ENC_CLASS (klass); ++ printf("mjpeg class init!\n"); ++ videoenc_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_mjpeg_enc_set_format); ++ videoenc_class->get_caps = GST_DEBUG_FUNCPTR (gst_omx_mjpeg_enc_get_caps); ++ ++ videoenc_class->cdata.default_src_template_caps = "image/jpeg"; ++ ++ gst_element_class_set_static_metadata (element_class, ++ "OpenMAX Mjpeg Video Encoder", ++ "Codec/Encoder/Video", ++ "Encode Mjpeg video streams", ++ "Sebastian Dröge "); ++ ++ gst_omx_set_default_role (&videoenc_class->cdata, "video_encoder.mjpeg"); ++} ++ ++static void ++gst_omx_mjpeg_enc_init (GstOMXMJPEGEnc * self) ++{ ++} ++ ++static gboolean ++gst_omx_mjpeg_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ GstOMXMJPEGEnc *self = GST_OMX_MJPEG_ENC (enc); ++ GstCaps *peercaps; ++ OMX_PARAM_PORTDEFINITIONTYPE port_def; ++ OMX_VIDEO_PARAM_PROFILELEVELTYPE param; ++ OMX_ERRORTYPE err; ++ guint profile_id, level_id; ++ ++ gst_omx_port_get_port_definition (GST_OMX_VIDEO_ENC (self)->enc_out_port, ++ &port_def); ++ port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingMJPEG; ++ err = ++ gst_omx_port_update_port_definition (GST_OMX_VIDEO_ENC ++ (self)->enc_out_port, &port_def); ++ if (err != OMX_ErrorNone) ++ return FALSE; ++ ++ GST_OMX_INIT_STRUCT (¶m); ++ param.nPortIndex = GST_OMX_VIDEO_ENC (self)->enc_out_port->index; ++ err = ++ gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc, ++ OMX_IndexParamVideoProfileLevelCurrent, ¶m); ++ if (err != OMX_ErrorNone) { ++ GST_WARNING_OBJECT (self, ++ "Getting profile/level not supported by component"); ++ return TRUE; ++ } ++ ++ peercaps = gst_pad_peer_query_caps (GST_VIDEO_ENCODER_SRC_PAD (enc), ++ gst_pad_get_pad_template_caps (GST_VIDEO_ENCODER_SRC_PAD (enc))); ++ if (peercaps) { ++ GstStructure *s; ++ ++ if (gst_caps_is_empty (peercaps)) { ++ gst_caps_unref (peercaps); ++ GST_ERROR_OBJECT (self, "Empty caps"); ++ return FALSE; ++ } ++ ++ s = gst_caps_get_structure (peercaps, 0); ++ gst_caps_unref (peercaps); ++ } ++ ++ err = ++ gst_omx_component_set_parameter (GST_OMX_VIDEO_ENC (self)->enc, ++ OMX_IndexParamVideoProfileLevelCurrent, ¶m); ++ if (err == OMX_ErrorUnsupportedIndex) { ++ GST_WARNING_OBJECT (self, ++ "Setting profile/level not supported by component"); ++ } else if (err != OMX_ErrorNone) { ++ GST_ERROR_OBJECT (self, ++ "Error setting profile %u and level %u: %s (0x%08x)", ++ (guint) param.eProfile, (guint) param.eLevel, ++ gst_omx_error_to_string (err), err); ++ return FALSE; ++ } ++ ++ return TRUE; ++ ++unsupported_profile: ++ GST_ERROR_OBJECT (self, "Unsupported profile %u", profile_id); ++ gst_caps_unref (peercaps); ++ return FALSE; ++ ++unsupported_level: ++ GST_ERROR_OBJECT (self, "Unsupported level %u", level_id); ++ gst_caps_unref (peercaps); ++ return FALSE; ++} ++ ++static GstCaps * ++gst_omx_mjpeg_enc_get_caps (GstOMXVideoEnc * enc, GstOMXPort * port, ++ GstVideoCodecState * state) ++{ ++ GstOMXMJPEGEnc *self = GST_OMX_MJPEG_ENC (enc); ++ GstCaps *caps; ++ OMX_ERRORTYPE err; ++ OMX_VIDEO_PARAM_PROFILELEVELTYPE param; ++ guint profile, level; ++ ++ caps = gst_caps_new_empty_simple ("image/jpeg"); ++ ++ GST_OMX_INIT_STRUCT (¶m); ++ param.nPortIndex = GST_OMX_VIDEO_ENC (self)->enc_out_port->index; ++ ++ err = ++ gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc, ++ OMX_IndexParamVideoProfileLevelCurrent, ¶m); ++ if (err != OMX_ErrorNone && err != OMX_ErrorUnsupportedIndex) { ++ gst_caps_unref (caps); ++ return NULL; ++ } ++ ++ return caps; ++} +diff --git a/omx/gstomxmjpegenc.h b/omx/gstomxmjpegenc.h +new file mode 100644 +index 0000000..e053d04 +--- /dev/null ++++ b/omx/gstomxmjpegenc.h +@@ -0,0 +1,59 @@ ++/* ++ * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. ++ * Author: Sebastian Dröge , Collabora Ltd. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation ++ * version 2.1 of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ */ ++ ++#ifndef __GST_OMX_MJPEG_ENC_H__ ++#define __GST_OMX_MJPEG_ENC_H__ ++ ++#include ++#include "gstomxvideoenc.h" ++ ++G_BEGIN_DECLS ++ ++#define GST_TYPE_OMX_MJPEG_ENC \ ++ (gst_omx_mjpeg_enc_get_type()) ++#define GST_OMX_MJPEG_ENC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_MJPEG_ENC,GstOMXMJPEGEnc)) ++#define GST_OMX_MJPEG_ENC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_MJPEG_ENC,GstOMXMJPEGEncClass)) ++#define GST_OMX_MJPEG_ENC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_MJPEG_ENC,GstOMXMJPEGEncClass)) ++#define GST_IS_OMX_MJPEG_ENC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_MJPEG_ENC)) ++#define GST_IS_OMX_MJPEG_ENC_CLASS(obj) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_MJPEG_ENC)) ++ ++typedef struct _GstOMXMJPEGEnc GstOMXMJPEGEnc; ++typedef struct _GstOMXMJPEGEncClass GstOMXMJPEGEncClass; ++ ++struct _GstOMXMJPEGEnc ++{ ++ GstOMXVideoEnc parent; ++}; ++ ++struct _GstOMXMJPEGEncClass ++{ ++ GstOMXVideoEncClass parent_class; ++}; ++ ++GType gst_omx_mjpeg_enc_get_type (void); ++ ++G_END_DECLS ++ ++#endif /* __GST_OMX_MJPEG_ENC_H__ */ +-- +2.7.4 + diff --git a/board/miyoo/patches/gst-omx/0003-add-for-zero-copy.patch b/board/miyoo/patches/gst-omx/0003-add-for-zero-copy.patch new file mode 100644 index 00000000..326c61d7 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0003-add-for-zero-copy.patch @@ -0,0 +1,83 @@ +From d3096c4fc4e7d13647df55a7c74dc5ba1e143bc7 Mon Sep 17 00:00:00 2001 +From: xiebin +Date: Tue, 2 Jan 2018 17:20:30 +0800 +Subject: [PATCH 4/4] add for zero copy + +--- + omx/gstomxbufferpool.c | 7 ++++++- + omx/gstomxvideo.c | 3 +++ + omx/openmax/OMX_IVCommon.h | 12 ++++++++++++ + 3 files changed, 21 insertions(+), 1 deletion(-) + +diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c +index b57612d..607bee8 100644 +--- a/omx/gstomxbufferpool.c ++++ b/omx/gstomxbufferpool.c +@@ -344,6 +344,7 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool, + GstOMXBufferPool *pool = GST_OMX_BUFFER_POOL (bpool); + GstBuffer *buf; + GstOMXBuffer *omx_buf; ++ GstMemoryFlags flags = 0; + + g_return_val_if_fail (pool->allocating, GST_FLOW_ERROR); + +@@ -389,7 +390,10 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool, + gsize offset[GST_VIDEO_MAX_PLANES] = { 0, }; + gint stride[GST_VIDEO_MAX_PLANES] = { nstride, 0, }; + +- mem = gst_omx_memory_allocator_alloc (pool->allocator, 0, omx_buf); ++ if(pool->port->port_def.bBuffersContiguous) ++ flags|= GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS; ++ ++ mem = gst_omx_memory_allocator_alloc (pool->allocator, flags, omx_buf); + buf = gst_buffer_new (); + gst_buffer_append_memory (buf, mem); + g_ptr_array_add (pool->buffers, buf); +@@ -405,6 +409,7 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool, + case GST_VIDEO_FORMAT_GRAY8: + break; + case GST_VIDEO_FORMAT_I420: ++ case GST_VIDEO_FORMAT_YV12: + stride[1] = nstride / 2; + offset[1] = offset[0] + stride[0] * nslice; + stride[2] = nstride / 2; +diff --git a/omx/gstomxvideo.c b/omx/gstomxvideo.c +index 8a42c71..fd4cad4 100644 +--- a/omx/gstomxvideo.c ++++ b/omx/gstomxvideo.c +@@ -44,6 +44,9 @@ gst_omx_video_get_format_from_omx (OMX_COLOR_FORMATTYPE omx_colorformat) + case OMX_COLOR_FormatYUV420PackedPlanar: + format = GST_VIDEO_FORMAT_I420; + break; ++ case OMX_COLOR_FormatYVU420Planar: ++ format = GST_VIDEO_FORMAT_YV12; ++ break; + case OMX_COLOR_FormatYUV420SemiPlanar: + case OMX_COLOR_FormatYUV420PackedSemiPlanar: + format = GST_VIDEO_FORMAT_NV12; +diff --git a/omx/openmax/OMX_IVCommon.h b/omx/openmax/OMX_IVCommon.h +index 4c4995c..367670b 100644 +--- a/omx/openmax/OMX_IVCommon.h ++++ b/omx/openmax/OMX_IVCommon.h +@@ -132,6 +132,18 @@ typedef enum OMX_COLOR_FORMATTYPE { + OMX_COLOR_Format24BitABGR6666, + OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ ++ //* extended by aw; ++ OMX_COLOR_FormatYVU420SemiPlanar, ++ OMX_COLOR_FormatYVU420Planar, ++ //* end; ++ ++ OMX_COLOR_FormatAndroidOpaque = 0x7F000789, ++ OMX_COLOR_FormatYUV420Flexible = 0x7F420888, ++ OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100, ++ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00, ++ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03, ++ OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002, ++ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m = 0x7FA30C04, + OMX_COLOR_FormatMax = 0x7FFFFFFF + } OMX_COLOR_FORMATTYPE; + +-- +2.7.4 + diff --git a/board/miyoo/patches/gst-omx/0004-patch-for-omx-drop-frames.patch b/board/miyoo/patches/gst-omx/0004-patch-for-omx-drop-frames.patch new file mode 100755 index 00000000..a7f31fa6 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0004-patch-for-omx-drop-frames.patch @@ -0,0 +1,33 @@ +>From 6b2c45cc5c93bd3d19467ffc22195d8dad32545f Mon Sep 17 00:00:00 2001 +From: xiebin +Date: Wed, 31 Jan 2018 13:38:08 +0800 +Subject: [PATCH 5/5] patch for omx drop frames + +--- + omx/gstomxvideodec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index 79b4daa..a88bdba 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -2171,6 +2171,7 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder, + guint offset = 0, size; + GstClockTime timestamp, duration; + OMX_ERRORTYPE err; ++ static int drop_num = 0; + + self = GST_OMX_VIDEO_DEC (decoder); + klass = GST_OMX_VIDEO_DEC_GET_CLASS (self); +@@ -2178,7 +2179,7 @@ gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder, + GST_DEBUG_OBJECT (self, "Handling frame"); + + if (!self->started) { +- if (!GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame)) { ++ if (!GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame) && drop_num++ < 20) { + gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame); + return GST_FLOW_OK; + } +-- +2.7.4 + diff --git a/board/miyoo/patches/gst-omx/0005-add-YV12-and-set-outport-for-enc.patch b/board/miyoo/patches/gst-omx/0005-add-YV12-and-set-outport-for-enc.patch new file mode 100755 index 00000000..fe9e7a6d --- /dev/null +++ b/board/miyoo/patches/gst-omx/0005-add-YV12-and-set-outport-for-enc.patch @@ -0,0 +1,56 @@ +diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c +index bfad2f3..36b6927 100644 +--- a/omx/gstomxvideoenc.c ++++ b/omx/gstomxvideoenc.c +@@ -1022,6 +1022,9 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder, + case GST_VIDEO_FORMAT_I420: + port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420Planar; + break; ++ case GST_VIDEO_FORMAT_YV12: ++ port_def.format.video.eColorFormat = OMX_COLOR_FormatYVU420Planar; ++ break; + case GST_VIDEO_FORMAT_NV12: + port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; + break; +@@ -1057,6 +1060,7 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder, + + switch (port_def.format.video.eColorFormat) { + case OMX_COLOR_FormatYUV420Planar: ++ case OMX_COLOR_FormatYVU420Planar: + case OMX_COLOR_FormatYUV420PackedPlanar: + port_def.nBufferSize = + (port_def.format.video.nStride * port_def.format.video.nFrameHeight) + +@@ -1135,8 +1139,13 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder, + } + + GST_DEBUG_OBJECT (self, "Updating outport port definition"); ++ ++ gst_omx_port_get_port_definition (self->enc_out_port, &port_def); ++ port_def.format.video.nFrameWidth = info->width; ++ port_def.format.video.nFrameHeight = info->height; ++ + if (gst_omx_port_update_port_definition (self->enc_out_port, +- NULL) != OMX_ErrorNone) ++ &port_def) != OMX_ErrorNone) + return FALSE; + + if (self->target_bitrate != 0xffffffff) { +@@ -1285,7 +1294,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf, + { + GstVideoCodecState *state = gst_video_codec_state_ref (self->input_state); + GstVideoInfo *info = &state->info; +- OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_in_port->port_def; ++ OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_out_port->port_def; + gboolean ret = FALSE; + GstVideoFrame frame; + +@@ -1310,7 +1319,8 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf, + /* Different strides */ + + switch (info->finfo->format) { +- case GST_VIDEO_FORMAT_I420:{ ++ case GST_VIDEO_FORMAT_I420: ++ case GST_VIDEO_FORMAT_YV12:{ + gint i, j, height, width; + guint8 *src, *dest; + gint src_stride, dest_stride; diff --git a/board/miyoo/patches/gst-omx/0006-add-YV12-format-output-for-dec.patch b/board/miyoo/patches/gst-omx/0006-add-YV12-format-output-for-dec.patch new file mode 100755 index 00000000..769154cd --- /dev/null +++ b/board/miyoo/patches/gst-omx/0006-add-YV12-format-output-for-dec.patch @@ -0,0 +1,12 @@ +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index 79b4daa..bbd123c 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -476,6 +476,7 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self, + dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo); + break; + case GST_VIDEO_FORMAT_I420: ++ case GST_VIDEO_FORMAT_YV12: + dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo); + src_stride[1] = nstride / 2; + src_size[1] = (src_stride[1] * nslice) / 2; diff --git a/board/miyoo/patches/gst-omx/0007-add-byte-stream-property-to-enable-nalu-when-use-omx-h264-enc.patch b/board/miyoo/patches/gst-omx/0007-add-byte-stream-property-to-enable-nalu-when-use-omx-h264-enc.patch new file mode 100644 index 00000000..d3fa2660 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0007-add-byte-stream-property-to-enable-nalu-when-use-omx-h264-enc.patch @@ -0,0 +1,123 @@ +diff --git a/omx/gstomxh264enc.c b/omx/gstomxh264enc.c +index aa33ae5..48ef3d7 100644 +--- a/omx/gstomxh264enc.c ++++ b/omx/gstomxh264enc.c +@@ -30,6 +30,7 @@ + #include + #include + #endif ++#include "OMX_IndexExt.h" + + GST_DEBUG_CATEGORY_STATIC (gst_omx_h264_enc_debug_category); + #define GST_CAT_DEFAULT gst_omx_h264_enc_debug_category +@@ -54,6 +55,7 @@ enum + #ifdef USE_OMX_TARGET_RPI + PROP_INLINESPSPPSHEADERS, + #endif ++ PROP_BYTE_STREAM, + PROP_PERIODICITYOFIDRFRAMES, + PROP_INTERVALOFCODINGINTRAFRAMES + }; +@@ -61,6 +63,7 @@ enum + #ifdef USE_OMX_TARGET_RPI + #define GST_OMX_H264_VIDEO_ENC_INLINE_SPS_PPS_HEADERS_DEFAULT TRUE + #endif ++#define GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT FALSE + #define GST_OMX_H264_VIDEO_ENC_PERIODICITY_OF_IDR_FRAMES_DEFAULT (0xffffffff) + #define GST_OMX_H264_VIDEO_ENC_INTERVAL_OF_CODING_INTRA_FRAMES_DEFAULT (0xffffffff) + +@@ -98,6 +101,11 @@ gst_omx_h264_enc_class_init (GstOMXH264EncClass * klass) + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | + GST_PARAM_MUTABLE_READY)); + #endif ++ g_object_class_install_property (gobject_class, PROP_BYTE_STREAM, ++ g_param_spec_boolean ("byte-stream", "Byte Stream", ++ "Generate byte stream format of NALU", ++ GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT, ++ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_PERIODICITYOFIDRFRAMES, + g_param_spec_uint ("periodicty-idr", "Target Bitrate", +@@ -146,6 +154,8 @@ gst_omx_h264_enc_set_property (GObject * object, guint prop_id, + self->inline_sps_pps_headers = g_value_get_boolean (value); + break; + #endif ++ case PROP_BYTE_STREAM: ++ self->byte_stream = g_value_get_boolean (value); + case PROP_PERIODICITYOFIDRFRAMES: + self->periodicty_idr = g_value_get_uint (value); + break; +@@ -170,6 +180,9 @@ gst_omx_h264_enc_get_property (GObject * object, guint prop_id, GValue * value, + g_value_set_boolean (value, self->inline_sps_pps_headers); + break; + #endif ++ case PROP_BYTE_STREAM: ++ g_value_set_boolean (value, self->byte_stream); ++ break; + case PROP_PERIODICITYOFIDRFRAMES: + g_value_set_uint (value, self->periodicty_idr); + break; +@@ -189,6 +202,7 @@ gst_omx_h264_enc_init (GstOMXH264Enc * self) + self->inline_sps_pps_headers = + GST_OMX_H264_VIDEO_ENC_INLINE_SPS_PPS_HEADERS_DEFAULT; + #endif ++ self->byte_stream = GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT; + self->periodicty_idr = + GST_OMX_H264_VIDEO_ENC_PERIODICITY_OF_IDR_FRAMES_DEFAULT; + self->interval_intraframes = +@@ -226,6 +240,7 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port, + OMX_PARAM_PORTDEFINITIONTYPE port_def; + OMX_VIDEO_PARAM_PROFILELEVELTYPE param; + OMX_VIDEO_CONFIG_AVCINTRAPERIOD config_avcintraperiod; ++ OMX_NALSTREAMFORMATTYPE config_nalstreamformattype; + #ifdef USE_OMX_TARGET_RPI + OMX_CONFIG_PORTBOOLEANTYPE config_inline_header; + #endif +@@ -263,6 +278,35 @@ gst_omx_h264_enc_set_format (GstOMXVideoEnc * enc, GstOMXPort * port, + } + #endif + ++ if (self->byte_stream != GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT) { ++ GST_OMX_INIT_STRUCT (&config_nalstreamformattype); ++ err = ++ gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc, ++ OMX_IndexParamNalStreamFormat, &config_nalstreamformattype); ++ if (err != OMX_ErrorNone) { ++ GST_ERROR_OBJECT (self, ++ "can't get OMX_IndexParamNalStreamFormat %s (0x%08x)", ++ gst_omx_error_to_string (err), err); ++ return FALSE; ++ } ++ ++ GST_DEBUG_OBJECT (self, "default Nal Stream Format:%u", ++ (guint) config_nalstreamformattype.eNaluFormat); ++ ++ if (self->byte_stream != GST_OMX_H264_VIDEO_ENC_BYTE_STREAM_DEFAULT) ++ config_nalstreamformattype.eNaluFormat = OMX_NaluFormatFourByteInterleaveLength; ++ ++ err = ++ gst_omx_component_set_parameter (GST_OMX_VIDEO_ENC (self)->enc, ++ OMX_IndexParamNalStreamFormat, &config_nalstreamformattype); ++ if (err != OMX_ErrorNone) { ++ GST_ERROR_OBJECT (self, ++ "can't set OMX_IndexParamNalStreamFormat %s (0x%08x)", ++ gst_omx_error_to_string (err), err); ++ return FALSE; ++ } ++ } ++ + if (self->periodicty_idr != + GST_OMX_H264_VIDEO_ENC_PERIODICITY_OF_IDR_FRAMES_DEFAULT + || self->interval_intraframes != +diff --git a/omx/gstomxh264enc.h b/omx/gstomxh264enc.h +index 03326e1..d962d7b 100644 +--- a/omx/gstomxh264enc.h ++++ b/omx/gstomxh264enc.h +@@ -46,6 +46,7 @@ struct _GstOMXH264Enc + { + GstOMXVideoEnc parent; + ++ gboolean byte_stream; + #ifdef USE_OMX_TARGET_RPI + gboolean inline_sps_pps_headers; + #endif diff --git a/board/miyoo/patches/gst-omx/0007-modify-dec-to-adapt-changed-resolution-video.patch b/board/miyoo/patches/gst-omx/0007-modify-dec-to-adapt-changed-resolution-video.patch new file mode 100755 index 00000000..84421648 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0007-modify-dec-to-adapt-changed-resolution-video.patch @@ -0,0 +1,85 @@ +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index 38de95b..894f813 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -1879,9 +1879,12 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, + + GST_DEBUG_OBJECT (self, "Need to disable and drain decoder"); + ++ /* + gst_omx_video_dec_drain (decoder); + gst_omx_video_dec_flush (decoder); + gst_omx_port_set_flushing (out_port, 5 * GST_SECOND, TRUE); ++ */ ++ gst_omx_video_dec_flush (decoder); + + if (klass->cdata.hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) { + GST_VIDEO_DECODER_STREAM_UNLOCK (self); +@@ -1901,7 +1904,7 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, + gst_omx_port_set_flushing (self->egl_out_port, 5 * GST_SECOND, TRUE); + } + #endif +- ++ /* + if (gst_omx_port_set_enabled (self->dec_in_port, FALSE) != OMX_ErrorNone) + return FALSE; + if (gst_omx_port_set_enabled (out_port, FALSE) != OMX_ErrorNone) +@@ -1921,7 +1924,7 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, + return FALSE; + if (gst_omx_port_wait_enabled (out_port, 1 * GST_SECOND) != OMX_ErrorNone) + return FALSE; +- ++ */ + #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL) + if (self->eglimage) { + OMX_STATETYPE egl_state; +@@ -1959,6 +1962,9 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, + self->input_state = NULL; + + GST_DEBUG_OBJECT (self, "Decoder drained and disabled"); ++ /* The local port_def is now obsolete so get it again. */ ++ if (!needs_disable) ++ gst_omx_port_get_port_definition (self->dec_in_port, &port_def); + } + + port_def.format.video.nFrameWidth = info->width; +@@ -1994,15 +2000,17 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, + if (needs_disable) { + if (gst_omx_port_set_enabled (self->dec_in_port, TRUE) != OMX_ErrorNone) + return FALSE; ++ /* + if (gst_omx_port_allocate_buffers (self->dec_in_port) != OMX_ErrorNone) + return FALSE; +- ++ */ + if ((klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) { + if (gst_omx_port_set_enabled (self->dec_out_port, TRUE) != OMX_ErrorNone) + return FALSE; ++ /* + if (gst_omx_port_allocate_buffers (self->dec_out_port) != OMX_ErrorNone) + return FALSE; +- ++ */ + if (gst_omx_port_wait_enabled (self->dec_out_port, + 5 * GST_SECOND) != OMX_ErrorNone) + return FALSE; +@@ -2100,7 +2108,9 @@ gst_omx_video_dec_flush (GstVideoDecoder * decoder) + + /* 1) Flush the ports */ + GST_DEBUG_OBJECT (self, "flushing ports"); ++ /* + gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, TRUE); ++ */ + gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, TRUE); + + #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL) +@@ -2129,7 +2139,9 @@ gst_omx_video_dec_flush (GstVideoDecoder * decoder) + #endif + + /* 4) Unset flushing to allow ports to accept data again */ ++ /* + gst_omx_port_set_flushing (self->dec_in_port, 5 * GST_SECOND, FALSE); ++ */ + gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, FALSE); + + #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL) diff --git a/board/miyoo/patches/gst-omx/0009-Remove-check-error-on-port-disabling.patch b/board/miyoo/patches/gst-omx/0009-Remove-check-error-on-port-disabling.patch new file mode 100644 index 00000000..573f3e08 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0009-Remove-check-error-on-port-disabling.patch @@ -0,0 +1,38 @@ +From 68550592fadb8aae28f3c84813e76d2c07ba4059 Mon Sep 17 00:00:00 2001 +From: tiopex +Date: Wed, 11 Jun 2025 13:14:33 +0200 +Subject: [PATCH] Remove check error on port disabling + +--- + omx/gstomx.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/omx/gstomx.c b/omx/gstomx.c +index 038ce32..d9f8af0 100644 +--- a/omx/gstomx.c ++++ b/omx/gstomx.c +@@ -3185,8 +3185,8 @@ gst_omx_port_wait_enabled_unlocked (GstOMXPort * port, GstClockTime timeout) + + if (timeout == 0) { + if (port->enabled_pending || port->disabled_pending) +- err = OMX_ErrorTimeout; +- goto done; ++ err = OMX_ErrorNone; ++ //goto done; + } + + /* And now wait until the enable/disable command is finished */ +@@ -3210,8 +3210,8 @@ gst_omx_port_wait_enabled_unlocked (GstOMXPort * port, GstClockTime timeout) + GST_ERROR_OBJECT (comp->parent, + "Timeout waiting for %s port %u to be %s", comp->name, port->index, + (enabled ? "enabled" : "disabled")); +- err = OMX_ErrorTimeout; +- goto done; ++ err = OMX_ErrorNone; ++ //goto done; + } else if (last_error != OMX_ErrorNone) { + GST_ERROR_OBJECT (comp->parent, + "Got error while waiting for %s port %u to be %s: %s (0x%08x)", +-- +2.34.1 + diff --git a/board/miyoo/patches/gst-omx/0010-Add-gst-raw.py-script.patch b/board/miyoo/patches/gst-omx/0010-Add-gst-raw.py-script.patch new file mode 100644 index 00000000..dfc03951 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0010-Add-gst-raw.py-script.patch @@ -0,0 +1,60 @@ +From 50913a1d0fe6f3b074f1dd3847ed5ffb401284a9 Mon Sep 17 00:00:00 2001 +From: tiopxyz +Date: Mon, 7 Jul 2025 13:45:56 +0200 +Subject: [PATCH] Add gst-raw.py script + +--- + config/miyoo/gst-raw.py | 41 +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 41 insertions(+) + create mode 100644 config/miyoo/gst-raw.py + +diff --git a/config/miyoo/gst-raw.py b/config/miyoo/gst-raw.py +new file mode 100644 +index 0000000..4ccfb0f +--- /dev/null ++++ b/config/miyoo/gst-raw.py +@@ -0,0 +1,41 @@ ++#!/usr/bin/env python3 ++import subprocess ++import sys ++import termios ++import tty ++import signal ++ ++if len(sys.argv) < 2: ++ print("Usage: python3 p.py ") ++ sys.exit(1) ++ ++filename = sys.argv[1] ++ ++cmd = [ ++ 'gst-launch-1.0', ++ 'filesrc', 'location=' + filename, ++ '!', 'qtdemux', 'name=demux', ++ 'demux.audio_0', '!', 'queue', '!', 'decodebin', '!', 'audioconvert', '!', 'alsasink', ++ 'demux.video_0', '!', 'queue', '!', 'decodebin', '!', ++ 'sunxifbsink', 'hardware-overlay=true', 'video-memory=2', 'buffer-pool=true', 'full-screen=true', '-e', '-q', '-f' ++] ++ ++proc = subprocess.Popen(cmd) ++ ++def get_key(): ++ fd = sys.stdin.fileno() ++ old = termios.tcgetattr(fd) ++ try: ++ tty.setraw(fd) ++ ch = sys.stdin.read(1) ++ finally: ++ termios.tcsetattr(fd, termios.TCSADRAIN, old) ++ return ch ++ ++_ = get_key() ++print("Key pressed, terminating gst-launch...") ++proc.send_signal(signal.SIGINT) ++ ++proc.wait() ++print("gst-launch stopped.") ++ +-- +2.34.1 + diff --git a/board/miyoo/patches/gst-omx/0011-omxvideodec-remove-resolution-check-with-goto-in-fil.patch b/board/miyoo/patches/gst-omx/0011-omxvideodec-remove-resolution-check-with-goto-in-fil.patch new file mode 100644 index 00000000..7c1a7430 --- /dev/null +++ b/board/miyoo/patches/gst-omx/0011-omxvideodec-remove-resolution-check-with-goto-in-fil.patch @@ -0,0 +1,25 @@ +From 625e183efb5a59434c14b008696e54224014adda Mon Sep 17 00:00:00 2001 +From: tiopex +Date: Fri, 20 Jun 2025 23:41:18 +0200 +Subject: [PATCH] omxvideodec: remove resolution check with goto in fill_buffer + +--- + omx/gstomxvideodec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index e044c78..e441cd4 100755 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -544,7 +544,7 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self, + (guint) port_def->format.video.nFrameWidth, + (guint) port_def->format.video.nFrameHeight, + vinfo->width, vinfo->height); +- goto done; ++ //goto done; + } + + /* Same strides and everything */ +-- +2.34.1 + diff --git a/board/miyoo/patches/gst-omx/0012-Add-player.patch b/board/miyoo/patches/gst-omx/0012-Add-player.patch new file mode 100644 index 00000000..1e20d4dc --- /dev/null +++ b/board/miyoo/patches/gst-omx/0012-Add-player.patch @@ -0,0 +1,313 @@ +From 4422f386b9dd03980f93563d57b1eaf9e72e1f0a Mon Sep 17 00:00:00 2001 +From: tiopex +Date: Tue, 15 Jul 2025 11:24:51 +0200 +Subject: [PATCH] gst-play + +--- + Makefile.am | 2 +- + configure.ac | 1 + + player/Makefile.am | 5 + + player/gst-play.c | 257 +++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 264 insertions(+), 1 deletion(-) + create mode 100644 player/Makefile.am + create mode 100644 player/gst-play.c + +diff --git a/Makefile.am b/Makefile.am +index 82affc6..e8c9581 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,4 @@ +-SUBDIRS = common omx tools config m4 ++SUBDIRS = common omx tools config m4 player + + if BUILD_EXAMPLES + SUBDIRS += examples +diff --git a/configure.ac b/configure.ac +index b1ef5fa..f2a98ce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -388,6 +388,7 @@ config/rpi/Makefile + examples/Makefile + examples/egl/Makefile + m4/Makefile ++player/Makefile + ) + + AC_OUTPUT +diff --git a/player/Makefile.am b/player/Makefile.am +new file mode 100644 +index 0000000..a8f7c4c +--- /dev/null ++++ b/player/Makefile.am +@@ -0,0 +1,5 @@ ++bin_PROGRAMS = gst-play ++ ++gst_play_SOURCES = gst-play.c ++gst_play_CFLAGS = $(GST_CFLAGS) ++gst_play_LDADD = $(GST_LIBS) +diff --git a/player/gst-play.c b/player/gst-play.c +new file mode 100644 +index 0000000..c1a5fa7 +--- /dev/null ++++ b/player/gst-play.c +@@ -0,0 +1,257 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++void reset_terminal_mode(void); ++void set_conio_terminal_mode(void); ++int kbhit(void); ++void int_handler(int dummy); ++static void on_pad_added(GstElement *src, GstPad *pad, gpointer user_data); ++ ++static gboolean running = TRUE; ++static GstElement *pipeline; ++static GstElement *video_sink; ++static gboolean paused = FALSE; ++ ++static struct termios orig_termios; ++ ++void reset_terminal_mode(void) { ++ tcsetattr(STDIN_FILENO, TCSANOW, &orig_termios); ++} ++ ++void set_conio_terminal_mode(void) { ++ struct termios new_termios; ++ ++ tcgetattr(STDIN_FILENO, &orig_termios); ++ memcpy(&new_termios, &orig_termios, sizeof(new_termios)); ++ ++ new_termios.c_lflag &= ~(ICANON | ECHO); ++ new_termios.c_cc[VMIN] = 0; ++ new_termios.c_cc[VTIME] = 0; ++ ++ tcsetattr(STDIN_FILENO, TCSANOW, &new_termios); ++ ++ atexit(reset_terminal_mode); ++} ++ ++int kbhit(void) { ++ unsigned char ch; ++ int nread; ++ ++ nread = read(STDIN_FILENO, &ch, 1); ++ if (nread == 1) { ++ if (ch == 0x1B) { // ESC ++ unsigned char seq[2]; ++ if (read(STDIN_FILENO, &seq[0], 1) == 0) return 27; ++ if (read(STDIN_FILENO, &seq[1], 1) == 0) return 27; ++ ++ if (seq[0] == '[') { ++ switch (seq[1]) { ++ case 'D': ++ return 1000; // Left arrow ++ case 'C': ++ return 1001; // Right arrow ++ default: ++ return 27; // ESC ++ } ++ } ++ return 27; ++ } ++ return ch; ++ } ++ return -1; ++} ++ ++void int_handler(int dummy) { ++ running = FALSE; ++} ++ ++static void on_pad_added(GstElement *src, GstPad *pad, gpointer user_data) { ++ GstCaps *caps; ++ const gchar *name; ++ ++ caps = gst_pad_get_current_caps(pad); ++ name = gst_structure_get_name(gst_caps_get_structure(caps, 0)); ++ ++ if (g_str_has_prefix(name, "audio/")) { ++ GstElement *queue = gst_element_factory_make("queue", NULL); ++ GstElement *convert = gst_element_factory_make("audioconvert", NULL); ++ GstElement *sink = gst_element_factory_make("autoaudiosink", NULL); ++ GstPad *sinkpad; ++ ++ gst_bin_add_many(GST_BIN(pipeline), queue, convert, sink, NULL); ++ gst_element_sync_state_with_parent(queue); ++ gst_element_sync_state_with_parent(convert); ++ gst_element_sync_state_with_parent(sink); ++ ++ gst_element_link_many(queue, convert, sink, NULL); ++ ++ sinkpad = gst_element_get_static_pad(queue, "sink"); ++ if (gst_pad_link(pad, sinkpad) != GST_PAD_LINK_OK) ++ g_printerr("Failed to link audio pad\n"); ++ gst_object_unref(sinkpad); ++ } else if (g_str_has_prefix(name, "video/")) { ++ GstElement *queue = gst_element_factory_make("queue", NULL); ++ GstElement *sink = video_sink; ++ GstPad *sinkpad; ++ ++ gst_bin_add_many(GST_BIN(pipeline), queue, NULL); ++ gst_element_sync_state_with_parent(queue); ++ ++ gst_element_link(queue, sink); ++ ++ sinkpad = gst_element_get_static_pad(queue, "sink"); ++ if (gst_pad_link(pad, sinkpad) != GST_PAD_LINK_OK) ++ g_printerr("Failed to link video pad\n"); ++ gst_object_unref(sinkpad); ++ } ++ ++ gst_caps_unref(caps); ++} ++ ++int main(int argc, char *argv[]) { ++ GstElement *src; ++ GstElement *demuxer; ++ GstBus *bus; ++ GstMessage *msg; ++ ++ if (argc < 2) { ++ g_printerr("Usage: %s \n", argv[0]); ++ return -1; ++ } ++ ++ gst_init(&argc, &argv); ++ ++ src = gst_element_factory_make("filesrc", "src"); ++ demuxer = gst_element_factory_make("decodebin", "decoder"); ++ video_sink = gst_element_factory_make("sunxifbsink", "sink"); ++ ++ if (!src || !demuxer || !video_sink) { ++ g_printerr("Failed to create elements\n"); ++ return -1; ++ } ++ ++ g_object_set(src, "location", argv[1], NULL); ++ g_object_set(video_sink, "hardware-overlay", TRUE, ++ "video-memory", 2, ++ "buffer-pool", TRUE, ++ "full-screen", TRUE, NULL); ++ ++ pipeline = gst_pipeline_new("player"); ++ ++ gst_bin_add_many(GST_BIN(pipeline), src, demuxer, video_sink, NULL); ++ ++ if (!gst_element_link(src, demuxer)) { ++ g_printerr("Could not link src -> decoder\n"); ++ return -1; ++ } ++ ++ g_signal_connect(demuxer, "pad-added", G_CALLBACK(on_pad_added), NULL); ++ ++ gst_element_set_state(pipeline, GST_STATE_PLAYING); ++ paused = FALSE; ++ g_print("Playing '%s'\n", argv[1]); ++ g_print("Controls: SPACE=play/pause, ESC=quit, LEFT/RIGHT=seek -/+5s\n"); ++ ++ signal(SIGINT, int_handler); ++ set_conio_terminal_mode(); ++ ++ while (running) { ++ int c = kbhit(); ++ ++ if (c != -1) { ++ if (c == ' ') { ++ if (paused) { ++ gst_element_set_state(pipeline, GST_STATE_PLAYING); ++ paused = FALSE; ++ g_print("Resumed\n"); ++ } else { ++ gst_element_set_state(pipeline, GST_STATE_PAUSED); ++ paused = TRUE; ++ g_print("Paused\n"); ++ } ++ } else if (c == 27) { ++ g_print("Exiting...\n"); ++ running = FALSE; ++ } else if (c == 1000 || c == 1001) { ++ gint64 current_pos; ++ gint64 duration; ++ gint64 seek_offset; ++ gint64 new_pos; ++ gboolean res; ++ ++ current_pos = GST_CLOCK_TIME_NONE; ++ duration = GST_CLOCK_TIME_NONE; ++ ++ if (!gst_element_query_position(pipeline, GST_FORMAT_TIME, ¤t_pos)) { ++ g_print("Cannot query position\n"); ++ continue; ++ } ++ ++ if (!gst_element_query_duration(pipeline, GST_FORMAT_TIME, &duration)) { ++ g_print("Cannot query duration\n"); ++ continue; ++ } ++ ++ seek_offset = 5 * GST_SECOND; ++ if (c == 1000) ++ seek_offset = -seek_offset; ++ ++ new_pos = current_pos + seek_offset; ++ ++ if (new_pos < 0) ++ new_pos = 0; ++ if (new_pos > duration) ++ new_pos = duration; ++ ++ res = gst_element_seek_simple( ++ pipeline, ++ GST_FORMAT_TIME, ++ GST_SEEK_FLAG_FLUSH, ++ new_pos); ++ ++ if (res) { ++ g_print("Seeked to %" GST_TIME_FORMAT "\n", GST_TIME_ARGS(new_pos)); ++ } else { ++ g_print("Seek failed\n"); ++ } ++ } ++ } ++ ++ bus = gst_element_get_bus(pipeline); ++ while ((msg = gst_bus_pop(bus)) != NULL) { ++ switch (GST_MESSAGE_TYPE(msg)) { ++ case GST_MESSAGE_EOS: ++ g_print("End of stream\n"); ++ running = FALSE; ++ break; ++ case GST_MESSAGE_ERROR: { ++ GError *err; ++ gchar *dbg; ++ gst_message_parse_error(msg, &err, &dbg); ++ g_printerr("Error: %s\n", err->message); ++ g_error_free(err); ++ g_free(dbg); ++ running = FALSE; ++ break; ++ } ++ default: ++ break; ++ } ++ gst_message_unref(msg); ++ } ++ gst_object_unref(bus); ++ ++ usleep(100 * 1000); // 100ms ++ } ++ ++ gst_element_set_state(pipeline, GST_STATE_NULL); ++ gst_object_unref(pipeline); ++ g_print("Pipeline stopped\n"); ++ ++ return 0; ++} +-- +2.34.1 + diff --git a/configs/miyoo_musl_defconfig b/configs/miyoo_musl_defconfig index bd90b739..7dbcbb43 100644 --- a/configs/miyoo_musl_defconfig +++ b/configs/miyoo_musl_defconfig @@ -30,7 +30,7 @@ BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/MiyooCFW/kernel.git" BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="origin/master" -BR2_LINUX_KERNEL_PATCH="board/miyoo/kernel" +BR2_LINUX_KERNEL_PATCH="board/miyoo/kernel/patch/musl" BR2_LINUX_KERNEL_DEFCONFIG="miyoo" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="suniv-f1c100s-miyoo suniv-f1c100s-miyoo-4bit" @@ -47,14 +47,32 @@ BR2_PACKAGE_FFMPEG_FFPLAY=y BR2_PACKAGE_FFMPEG_FFPROBE=y BR2_PACKAGE_FFMPEG_AVRESAMPLE=y BR2_PACKAGE_FFMPEG_POSTPROC=y -BR2_PACKAGE_FFMPEG_ENCODERS="aac ac3 flac jpegls libx264 libx264rgb libopus mpeg1video mpeg2video mpeg4 pcm_s16be pcm_s16le pcm_s16le_planar png rawvideo vorbis wavpack zlib" +BR2_PACKAGE_FFMPEG_ENCODERS="aac ac3 flac jpegls libx264 libx264rgb libopus mpeg1video mpeg2video mpeg4 pcm_s16be pcm_s16le pcm_s16le_planar png rawvideo vorbis wavpack zlib h264_omx" BR2_PACKAGE_FFMPEG_DECODERS="aac ac3 flac jpegls libopus mp2 mp3 mpeg1video mpeg2video mpeg4 mpegvideo png h264 hevc vc1 opus pcm_s16be pcm_s16le pcm_s16le_planar rawvideo vorbis wavpack yuv4 zlib" BR2_PACKAGE_FFMPEG_MUXERS="ac3 avi flac ffm h264 hevc matroska ogg opus mov mp3 mp4 mpeg1video mpeg2video mpegts m4v pcm_s16be pcm_s16le rawvideo rtp wav yuv4mpegpipe" BR2_PACKAGE_FFMPEG_DEMUXERS="aac avi h264 flac matroska mov mp3 mpegps mpegts mpegvideo ogg pcm_s16be pcm_s16le rawvideo wav yuv4mpegpipe" BR2_PACKAGE_FFMPEG_PARSERS="aac flac ac3 h264 hevc mpegaudio mpeg4video mpegvideo opus vc1 vorbis" BR2_PACKAGE_FFMPEG_BSFS="" BR2_PACKAGE_FFMPEG_PROTOCOLS="file" -BR2_PACKAGE_FFMPEG_EXTRACONF="--enable-small" +BR2_PACKAGE_FFMPEG_EXTRACONF="--enable-small --enable-omx" +BR2_PACKAGE_GSTREAMER1=y +BR2_PACKAGE_GST1_PLUGINS_BASE_INSTALL_TOOLS=y +BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOCONVERT=y +BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEORATE=y +BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_ALSA=y +BR2_PACKAGE_GST1_PLUGINS_GOOD=y +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_AUTODETECT=y +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_MATROSKA=y +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_VIDEOFILTER=y +BR2_PACKAGE_GST1_PLUGINS_BAD=y +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_AUTOCONVERT=y +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_RAWPARSE=y +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOPARSERS=y +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOSIGNAL=y +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FBDEV=y +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FDK_AAC=y +BR2_PACKAGE_GST_FBDEV2_PLUGINS=y +BR2_PACKAGE_GST_OMX=y BR2_PACKAGE_VORBIS_TOOLS=y BR2_PACKAGE_P7ZIP=y BR2_PACKAGE_XZ=y @@ -115,6 +133,10 @@ BR2_PACKAGE_DBUS=y BR2_PACKAGE_GPTFDISK=y BR2_PACKAGE_GPTFDISK_GDISK=y BR2_PACKAGE_GPTFDISK_SGDISK=y +BR2_PACKAGE_LIBCEDARC=y +BR2_PACKAGE_LIBCEDARC_ARCHLIB="toolchain-sunxi-arm9-musl" +BR2_PACKAGE_LIBCEDARC_DECODER=y +BR2_PACKAGE_LIBCEDARC_OPENMAX=y BR2_PACKAGE_LINUXCONSOLETOOLS=y BR2_PACKAGE_LINUXCONSOLETOOLS_JOYSTICK=y BR2_PACKAGE_PARTED=y diff --git a/package/Config.in b/package/Config.in index 27743ee2..bca10f45 100644 --- a/package/Config.in +++ b/package/Config.in @@ -515,6 +515,7 @@ endmenu source "package/joy2key/Config.in" source "package/kbd/Config.in" source "package/lcdproc/Config.in" + source "package/libcedarc/Config.in" source "package/libiec61850/Config.in" source "package/libubootenv/Config.in" source "package/libuio/Config.in" diff --git a/package/ffmpeg/ffmpeg.mk b/package/ffmpeg/ffmpeg.mk index 6b692f11..86353332 100644 --- a/package/ffmpeg/ffmpeg.mk +++ b/package/ffmpeg/ffmpeg.mk @@ -59,7 +59,7 @@ FFMPEG_CONF_OPTS = \ --disable-symver \ --disable-doc -FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf +FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf $(if $(BR2_PACKAGE_LIBCEDARC),libcedarc) ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y) FFMPEG_CONF_OPTS += --enable-gpl diff --git a/package/gstreamer1/Config.in b/package/gstreamer1/Config.in index 8fe8a343..086895d0 100644 --- a/package/gstreamer1/Config.in +++ b/package/gstreamer1/Config.in @@ -7,6 +7,7 @@ source "package/gstreamer1/gst1-plugins-bayer2rgb-neon/Config.in" source "package/gstreamer1/gst1-plugins-good/Config.in" source "package/gstreamer1/gst1-plugins-bad/Config.in" source "package/gstreamer1/gst1-plugins-ugly/Config.in" +source "package/gstreamer1/gst-fbdev2-plugins/Config.in" source "package/gstreamer1/gst1-devtools/Config.in" source "package/gstreamer1/gst1-imx/Config.in" source "package/gstreamer1/gst1-interpipe/Config.in" diff --git a/package/gstreamer1/gst-fbdev2-plugins/0001-framebuffersink-remove-log-for-unexpected-system-mem.patch b/package/gstreamer1/gst-fbdev2-plugins/0001-framebuffersink-remove-log-for-unexpected-system-mem.patch new file mode 100644 index 00000000..05190801 --- /dev/null +++ b/package/gstreamer1/gst-fbdev2-plugins/0001-framebuffersink-remove-log-for-unexpected-system-mem.patch @@ -0,0 +1,28 @@ +From 6b5a236aeaac29afa607ac84246c9f840a61f24a Mon Sep 17 00:00:00 2001 +From: tiopex +Date: Fri, 20 Jun 2025 23:48:05 +0200 +Subject: [PATCH] framebuffersink: remove log for unexpected system memory + overlay + +--- + src/gstframebuffersink.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/gstframebuffersink.c b/src/gstframebuffersink.c +index 934e6eb..a967cdb 100644 +--- a/src/gstframebuffersink.c ++++ b/src/gstframebuffersink.c +@@ -2299,8 +2299,8 @@ GstBuffer * buf) + overlay frame from system memory (which shouldn't normally happen) + poses a bit of problem. We need to allocate a temporary video memory + area to store the overlay frame and show it. */ +- GST_FRAMEBUFFERSINK_MESSAGE_OBJECT (framebuffersink, +- "Unexpected system memory overlay in buffer pool mode"); ++// GST_FRAMEBUFFERSINK_MESSAGE_OBJECT (framebuffersink, ++// "Unexpected system memory overlay in buffer pool mode"); + + GstMemory *vmem; + vmem = gst_allocator_alloc( +-- +2.34.1 + diff --git a/package/gstreamer1/gst-fbdev2-plugins/0002-sunxifbsink-infer-input-width-height-from-upstream-c.patch b/package/gstreamer1/gst-fbdev2-plugins/0002-sunxifbsink-infer-input-width-height-from-upstream-c.patch new file mode 100644 index 00000000..8ebb8236 --- /dev/null +++ b/package/gstreamer1/gst-fbdev2-plugins/0002-sunxifbsink-infer-input-width-height-from-upstream-c.patch @@ -0,0 +1,71 @@ +From c8cb9db356cb7edba473ecf58ddad1209b6fd5e2 Mon Sep 17 00:00:00 2001 +From: tiopxyz +Date: Thu, 10 Jul 2025 15:08:29 +0200 +Subject: [PATCH] sunxifbsink: infer input width/height from upstream caps if + not set manually + +--- + src/gstframebuffersink.c | 47 +++++++++++++++++++++++++--------------- + 1 file changed, 30 insertions(+), 17 deletions(-) + +diff --git a/src/gstframebuffersink.c b/src/gstframebuffersink.c +index a967cdb..9d43c24 100644 +--- a/src/gstframebuffersink.c ++++ b/src/gstframebuffersink.c +@@ -1144,23 +1144,36 @@ gst_framebuffersink_caps_set_preferences (GstFramebufferSink *framebuffersink, + /* If hardware scaling is supported, and a specific video size is requested, + allow any reasonable size (except when the width/height_before_scaler + properties are set) and use the scaler. */ +- if (framebuffersink->use_hardware_overlay && +- (framebuffersink->requested_video_width != 0 || +- framebuffersink->requested_video_height != 0)) { +- if (framebuffersink->width_before_scaling != 0) +- gst_caps_set_simple (caps, "width", G_TYPE_INT, +- framebuffersink->width_before_scaling, NULL); +- else +- gst_caps_set_simple (caps, "width", GST_TYPE_INT_RANGE, 1, +- GST_VIDEO_INFO_WIDTH (&framebuffersink->screen_info), NULL); +- if (framebuffersink->height_before_scaling != 0) +- gst_caps_set_simple (caps, "height", G_TYPE_INT, +- framebuffersink->height_before_scaling, NULL); +- else +- gst_caps_set_simple (caps, "height", GST_TYPE_INT_RANGE, 1, +- GST_VIDEO_INFO_HEIGHT (&framebuffersink->screen_info), NULL); +- goto skip_video_size_request; +- } ++ if (framebuffersink->use_hardware_overlay && ++ (framebuffersink->requested_video_width != 0 || ++ framebuffersink->requested_video_height != 0)) { ++ ++ gint upstream_width = 0; ++ gint upstream_height = 0; ++ ++ GstStructure *structure = gst_caps_get_structure(caps, 0); ++ gst_structure_get_int(structure, "width", &upstream_width); ++ gst_structure_get_int(structure, "height", &upstream_height); ++ ++ // width ++ if (framebuffersink->width_before_scaling != 0) { ++ gst_caps_set_simple(caps, "width", G_TYPE_INT, ++ framebuffersink->width_before_scaling, NULL); ++ } else if (upstream_width > 0) { ++ gst_caps_set_simple(caps, "width", G_TYPE_INT, upstream_width, NULL); ++ } ++ ++ // height ++ if (framebuffersink->height_before_scaling != 0) { ++ gst_caps_set_simple(caps, "height", G_TYPE_INT, ++ framebuffersink->height_before_scaling, NULL); ++ } else if (upstream_height > 0) { ++ gst_caps_set_simple(caps, "height", G_TYPE_INT, upstream_height, NULL); ++ } ++ ++ goto skip_video_size_request; ++ } ++ + + /* Honour video size requests, otherwise set the allowable range up to the + screen size. */ +-- +2.34.1 + diff --git a/package/gstreamer1/gst-fbdev2-plugins/Config.in b/package/gstreamer1/gst-fbdev2-plugins/Config.in new file mode 100644 index 00000000..90d94dde --- /dev/null +++ b/package/gstreamer1/gst-fbdev2-plugins/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_GST_FBDEV2_PLUGINS + bool "gst-fbdev2-plugins" + depends on BR2_PACKAGE_LIBCEDARC + select BR2_PACKAGE_GST1_PLUGINS_BASE + help + GStreamer plug-in to use sunxifbsink \ No newline at end of file diff --git a/package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.hash b/package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.hash new file mode 100644 index 00000000..d7357a72 --- /dev/null +++ b/package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 03d539f7286faf36fcbdf2a93371ba9945f65a13c8be4e62a6b9ab9a2dfad168 gst-fbdev2-plugins-d576ab21adbb5eacb1000a89fbaea14576784b10.tar.gz diff --git a/package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.mk b/package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.mk new file mode 100644 index 00000000..5a5f0fe8 --- /dev/null +++ b/package/gstreamer1/gst-fbdev2-plugins/gst-fbdev2-plugins.mk @@ -0,0 +1,19 @@ +################################################################################ +# +# gst-fbdev2-plugins +# +################################################################################ + +GST_FBDEV2_PLUGINS_VERSION = d576ab21adbb5eacb1000a89fbaea14576784b10 +GST_FBDEV2_PLUGINS_SITE = $(call github,hglm,gst-fbdev2-plugins,$(GST_FBDEV2_PLUGINS_VERSION)) + +GST_FBDEV2_PLUGINS_LICENSE = LGPL-2.1 +GST_FBDEV2_PLUGINS_LICENSE_FILES = COPYING +GST_FBDEV2_PLUGINS_DEPENDENCIES = gstreamer1 gst1-plugins-base gst-omx libglib2 libdrm libtool +GST_FBDEV2_PLUGINS_AUTORECONF = YES +define GST_FBDEV2_PLUGINS_PRE_PATCH_HOOK + $(SED) 's/-lgstframebuffersink/libgstframebuffersink.la/g' $(@D)/src/Makefile.am +endef +GST_FBDEV2_PLUGINS_PRE_PATCH_HOOKS += GST_FBDEV2_PLUGINS_PRE_PATCH_HOOK + +$(eval $(autotools-package)) diff --git a/package/gstreamer1/gst-omx/Config.in b/package/gstreamer1/gst-omx/Config.in index efe3d211..bf704fdf 100644 --- a/package/gstreamer1/gst-omx/Config.in +++ b/package/gstreamer1/gst-omx/Config.in @@ -1,11 +1,13 @@ config BR2_PACKAGE_GST_OMX bool "gst-omx" - depends on BR2_PACKAGE_HAS_LIBOPENMAX + depends on BR2_PACKAGE_HAS_LIBOPENMAX || \ + BR2_PACKAGE_LIBCEDARC select BR2_PACKAGE_GST1_PLUGINS_BASE help GStreamer plug-in to use OpenMAX API. https://cgit.freedesktop.org/gstreamer/gst-omx -comment "gst-omx requires a OpenMAX implementation" - depends on !BR2_PACKAGE_HAS_LIBOPENMAX +comment "gst-omx requires a libopenmax or libcedarc implementation" + depends on !BR2_PACKAGE_HAS_LIBOPENMAX && \ + !BR2_PACKAGE_LIBCEDARC diff --git a/package/gstreamer1/gst-omx/gst-omx.hash b/package/gstreamer1/gst-omx/gst-omx.hash index 140ad626..89af29c8 100644 --- a/package/gstreamer1/gst-omx/gst-omx.hash +++ b/package/gstreamer1/gst-omx/gst-omx.hash @@ -1,3 +1,3 @@ -# From https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-1.20.4.tar.xz.sha256sum -sha256 70ddd485e2dcab79070164d61ad2ff3a63e15a1d7abf9075d86eb77762b0edfd gst-omx-1.20.4.tar.xz -sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING +# From https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-1.10.4.tar.xz.sha256sum +sha256 45072925cf262f0fd528fab78f0de52734e46a5a88aa802fae51c67c09c81aa2 gst-omx-1.10.4.tar.xz +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING diff --git a/package/gstreamer1/gst-omx/gst-omx.mk b/package/gstreamer1/gst-omx/gst-omx.mk index d644c449..a5d0e293 100644 --- a/package/gstreamer1/gst-omx/gst-omx.mk +++ b/package/gstreamer1/gst-omx/gst-omx.mk @@ -4,36 +4,31 @@ # ################################################################################ -GST_OMX_VERSION = 1.20.4 +GST_OMX_VERSION = 1.10.4 GST_OMX_SOURCE = gst-omx-$(GST_OMX_VERSION).tar.xz GST_OMX_SITE = https://gstreamer.freedesktop.org/src/gst-omx GST_OMX_LICENSE = LGPL-2.1 GST_OMX_LICENSE_FILES = COPYING -GST_OMX_CONF_OPTS = \ - -Dexamples=disabled \ - -Dtests=disabled \ - -Dtools=disabled \ - -Ddoc=disabled +GST_OMX_VARIANT = bellagio +GST_OMX_CONF_ENV = \ + CFLAGS="$(TARGET_CFLAGS) \ + -DOMX_VERSION_MAJOR=1 \ + -DOMX_VERSION_MINOR=1 \ + -DOMX_VERSION_REVISION=2 \ + -DOMX_VERSION_STEP=0" -ifeq ($(BR2_PACKAGE_RPI_USERLAND),y) -GST_OMX_VARIANT = rpi -GST_OMX_CONF_OPTS += -Dheader_path=$(STAGING_DIR)/usr/include/IL -else -GST_OMX_VARIANT = generic -endif +GST_OMX_CONF_OPTS += --with-omx-target=$(GST_OMX_VARIANT) -GST_OMX_CONF_OPTS += -Dtarget=$(GST_OMX_VARIANT) - -GST_OMX_DEPENDENCIES = gstreamer1 gst1-plugins-base libopenmax +GST_OMX_DEPENDENCIES = gstreamer1 gst1-plugins-base libcedarc # adjust library paths to where buildroot installs them define GST_OMX_FIXUP_CONFIG_PATHS find $(@D)/config -name gstomx.conf | \ xargs $(SED) 's|/usr/local|/usr|g' -e 's|/opt/vc|/usr|g' endef - +GST_OMX_AUTORECONF = YES GST_OMX_POST_PATCH_HOOKS += GST_OMX_FIXUP_CONFIG_PATHS -$(eval $(meson-package)) +$(eval $(autotools-package)) diff --git a/package/libcedarc/0001-Add-converstion-to-YV12.patch b/package/libcedarc/0001-Add-converstion-to-YV12.patch new file mode 100644 index 00000000..75ae528c --- /dev/null +++ b/package/libcedarc/0001-Add-converstion-to-YV12.patch @@ -0,0 +1,435 @@ +From ec3025abfdec1bdebe76a5f92cce8de3a73bff60 Mon Sep 17 00:00:00 2001 +From: tiopxyz +Date: Fri, 11 Jul 2025 23:25:13 +0200 +Subject: [PATCH] F1C100s: VDU supports only YUV_MB32_420; convert manually to YV12 + +On F1C100s boards, the video decoder supports only the +YUV_MB32_420 format, which is YUV420 stored in 32×32 macroblocks. + +This format is not natively supported in GStreamer, so manual conversion +to standard YV12 is necessary for compatibility with existing video sinks. + +--- + openmax/vdec/src/omx_vdec_aw_decoder_linux.c | 75 +++++- + vdecoder/pixel_format.c | 258 +++++++++++++++++++ + 2 files changed, 330 insertions(+), 3 deletions(-) + +diff --git a/openmax/vdec/src/omx_vdec_aw_decoder_linux.c b/openmax/vdec/src/omx_vdec_aw_decoder_linux.c +index 8a619ca..2976fca 100644 +--- a/openmax/vdec/src/omx_vdec_aw_decoder_linux.c ++++ b/openmax/vdec/src/omx_vdec_aw_decoder_linux.c +@@ -71,6 +71,10 @@ typedef struct OmxAwDecoderContext + VideoPicture* pPicture; + + OMX_BOOL bUseZeroCopyBuffer; ++ char* pYV12; ++ VideoPicture CvtPicture; ++ int tWidth; ++ int tHeight; + + + }OmxAwDecoderContext; +@@ -403,6 +407,52 @@ static void liReopenVideoEngine(OmxAwDecoderContext *pCtx) + return ; + } + ++static int yv12_align_fill(char* p_dst, int w, int h, int aw, int ah) ++{ ++ int i, j; ++ int map = aw * ah; ++ int v_size = (map) >> 2; ++ char *pv = p_dst + map; ++ char *pu = pv + v_size;// / 4 ++ ++ int dw = aw - w; ++ int dh = ah -h; ++ int dw_h = dw / 2; ++ int dh_h = dh / 2; ++ int w_h = w / 2; ++ int h_h = h / 2; ++ int aw_h = aw / 2; ++ int ah_h = ah / 2; ++ int map_oft = aw_h * h_h; ++ ++ if((w == aw) && (h == ah)) ++ return 0; ++ ++ ++ for(i=0;imVideoConfig.nAlignStride = pCtx->mGpuAlignStride; + +- pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YV12;//* Used to be YV12. ++ pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YUV_MB32_420;//* Used to be YV12. + + #if (ENABLE_SCALEDOWN_WHEN_RESOLUTION_MOER_THAN_1080P) + if (pCtx->mStreamInfo.nWidth > 1920 +@@ -482,6 +532,10 @@ static int __liPrepare(OmxDecoder* pDec) + pCtx->mVideoConfig.nVerticalScaleDownRatio = 1; + } + #endif ++ pCtx->tWidth = pCtx->mStreamInfo.nWidth; ++ pCtx->tHeight = pCtx->mStreamInfo.nHeight; ++ pCtx->mStreamInfo.nWidth = (pCtx->mStreamInfo.nWidth + 31) & ~31; ++ pCtx->mStreamInfo.nHeight = (pCtx->mStreamInfo.nHeight + 31) & ~31; + + if(pCtx->mStreamInfo.eCodecFormat == VIDEO_CODEC_FORMAT_WMV3) + { +@@ -506,6 +560,14 @@ static int __liPrepare(OmxDecoder* pDec) + ret = InitializeVideoDecoder(pCtx->m_decoder, + &(pCtx->mStreamInfo), + &pCtx->mVideoConfig); ++ pCtx->pYV12 = (char*)malloc(sizeof(char) * pCtx->mStreamInfo.nWidth * pCtx->mStreamInfo.nHeight * 3 / 2); ++ if(pCtx->pYV12 == NULL) ++ { ++ loge("pCtx->pYV12 malloc fail\n"); ++ return -1; ++ } ++ pCtx->CvtPicture.pData0 = pCtx->pYV12; ++ pCtx->CvtPicture.ePixelFormat = PIXEL_FORMAT_YV12; + if(ret != 0) + { + DestroyVideoDecoder(pCtx->m_decoder); +@@ -706,12 +768,14 @@ static OMX_BUFFERHEADERTYPE* __liDrain(OmxDecoder* pDec) + pCtx->pPicture->nWidth, pCtx->pPicture->nHeight, + pCtx->pPicture->nTopOffset,pCtx->pPicture->nBottomOffset, + pCtx->pPicture->nLeftOffset,pCtx->pPicture->nRightOffset); ++ RotatePicture(pCtx->decMemOps, pCtx->pPicture, &pCtx->CvtPicture, 0, 32, 32); ++ yv12_align_fill(pCtx->CvtPicture.pData0, pCtx-> tWidth, pCtx-> tHeight, pCtx->mStreamInfo.nWidth, pCtx->mStreamInfo.nHeight); + CdcMemFlushCache(pCtx->decMemOps, (void*)pCtx->pPicture->pData0, + pCtx->pPicture->nLineStride * pCtx->pPicture->nHeight*3/2); + OMX_PARAM_PORTDEFINITIONTYPE* outDef = getPortDef(pCtx->pOutPort); + #if USE_ALIGN_SIZE + AlignCopyYV12((unsigned char*)pOutBufHdr->pBuffer, +- (unsigned char*)pCtx->pPicture->pData0, ++ (unsigned char*)pCtx->CvtPicture.pData0, + outDef->format.video.nFrameWidth, + outDef->format.video.nFrameHeight); + +@@ -785,6 +849,11 @@ static void __liClose(OmxDecoder* pDec) + DestroyVideoDecoder(pCtx->m_decoder); + pCtx->m_decoder = NULL; + } ++ if(pCtx->pYV12 != NULL) ++ { ++ free(pCtx->pYV12); ++ pCtx->pYV12 = NULL; ++ } + pCtx->mCodecSpecificDataLen = 0; + memset(pCtx->mCodecSpecificData, 0 , CODEC_SPECIFIC_DATA_LENGTH); + OmxReleaseMutex(pCtx->awMutexHandler); +@@ -835,7 +904,7 @@ static int __liSetOutputEos(OmxDecoder* pDec) + static void __liGetFormat(OmxDecoder* pDec) + { + OmxAwDecoderContext *pCtx = (OmxAwDecoderContext*)pDec; +- pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YV12; ++ pCtx->mVideoConfig.eOutputPixelFormat = PIXEL_FORMAT_YUV_MB32_420; + } + + static inline void __liSetExtBufNum(OmxDecoder* pDec, OMX_S32 num) +diff --git a/vdecoder/pixel_format.c b/vdecoder/pixel_format.c +index 3d47e6a..3fda569 100755 +--- a/vdecoder/pixel_format.c ++++ b/vdecoder/pixel_format.c +@@ -556,6 +556,259 @@ void ConvertMb32422ToYv12C(char* pSrc,char* pDstU, char*pDstV,int nPicWidth, int + //****************************************************************// + //****************************************************************// + ++static void MB32_CVT_YV12(char* pSrc, char* pSrc_v, char* pDst, int nWidth, int nHeight) ++{ ++ int i = 0; ++ int j = 0; ++ int m = 0; ++ int n = 0; ++ int k = 0; ++ int nMbWidth = 0; ++ int nMbHeight = 0; ++ int nMbWidth_uv = 0; ++ int nMbHeight_uv = 0; ++ int nLineStride = 0; ++ int nLineStride_uv = 0; ++ int lineNum = 0; ++ int lineNum_uv = 0; ++ int offset = 0; ++ int offset_uv = 0; ++ int maxNum = 0; ++ char* ptr = NULL; ++ char* ptr_uv = NULL; ++ char* pDstU = NULL; ++ char* pDstV = NULL; ++ int nWidth_uv = 0; ++ int nHeight_uv = 0; ++ char bufferY[32]; ++ char bufferV[16], bufferU[16]; ++ int nWidthMatchFlag = 0; ++ int nWidthMatchFlag_uv = 0; ++ int nCopyMbWidth = 0; ++ int nCopyMbWidth_uv = 0; ++ char *dstAsm = NULL; ++ char *dst0Asm = NULL; ++ char *dst1Asm = NULL; ++ char *srcAsm = NULL; ++ char *srcAsm_uv = NULL; ++ ++ int bCnt2 = 1; ++ ++ nLineStride = (nWidth + 15) &~15; ++ nMbWidth = (nWidth + 31)&~31; ++ nMbWidth >>= 5;//n 32 width / 32 ++ ++ nMbHeight = (nHeight + 31)&~31; ++ nMbHeight >>= 5;// / 32 ++ ptr = pSrc; ++ ++ nWidthMatchFlag = 0; ++ nCopyMbWidth = nMbWidth - 1; ++ ++ nWidth_uv = (nWidth + 1) / 2; ++ nHeight_uv = (nHeight + 1) / 2; ++ ++ nLineStride_uv = (nWidth_uv + 7)&~7; ++ ++ nMbWidth_uv = (nWidth_uv * 2 + 31)&~31; ++ nMbWidth_uv >>= 5;// / 32 ++ ++ nMbHeight_uv = (nHeight_uv + 31)&~31; ++ nMbHeight_uv >>= 5;// / 32 ++ ptr_uv = pSrc_v; ++ pDstU = pDst + (nWidth * nHeight) + (nWidth / 2 * nHeight / 2); ++ pDstV = pDst + (nWidth * nHeight); ++ nWidthMatchFlag_uv = 0; ++ nCopyMbWidth_uv = nMbWidth_uv - 1; ++ ++ if ((nMbWidth << 5) == nLineStride)// * 32 ++ { ++ nWidthMatchFlag = 1; ++ nCopyMbWidth = nMbWidth; ++ } ++ ++ if ((nMbWidth_uv << 4) == nLineStride_uv)//*16 ++ { ++ nWidthMatchFlag_uv = 1; ++ nCopyMbWidth_uv = nMbWidth_uv; ++ ++ } ++ ++ for (i = 0; i < nMbHeight; i++) ++ { ++ for (j = 0; j < nCopyMbWidth; j++) ++ { ++ for (m = 0; m < 32; m++) ++ { ++ if (((i << 5) + m) >= nHeight)// * 32 ++ { ++ ptr += 32; ++ continue; ++ } ++ srcAsm = ptr; ++ lineNum = (i << 5) + m; //line num * 32 ++ offset = lineNum * nLineStride + (j << 5);// * 32 ++ dstAsm = pDst + offset; ++ ++ memcpy(dstAsm, srcAsm, 32); ++ ++ if (bCnt2) ++ { ++ if (((i << 4) + m) >= nHeight_uv)//i / 2 * 32 ++ { ++ ptr_uv += 32; ++ ptr += 32; ++ continue; ++ } ++ srcAsm_uv = ptr_uv; ++ lineNum_uv = (i << 4) + m; //line num i / 2 * 32 ++ offset_uv = lineNum_uv * nLineStride_uv + (j << 4);// * 16 ++ dst0Asm = pDstU + offset_uv; ++ dst1Asm = pDstV + offset_uv; ++ ++ //memcpy(dst0Asm, srcAsm_uv, 16); ++ //memcpy(dst1Asm, (void *)(srcAsm_uv + 16), 16); ++ dst0Asm[0] = srcAsm_uv[0]; ++ dst0Asm[1] = srcAsm_uv[2]; ++ dst0Asm[2] = srcAsm_uv[4]; ++ dst0Asm[3] = srcAsm_uv[6]; ++ dst0Asm[4] = srcAsm_uv[8]; ++ dst0Asm[5] = srcAsm_uv[10]; ++ dst0Asm[6] = srcAsm_uv[12]; ++ dst0Asm[7] = srcAsm_uv[14]; ++ ++ dst0Asm[8] = srcAsm_uv[16]; ++ dst0Asm[9] = srcAsm_uv[18]; ++ dst0Asm[10] = srcAsm_uv[20]; ++ dst0Asm[11] = srcAsm_uv[22]; ++ dst0Asm[12] = srcAsm_uv[24]; ++ dst0Asm[13] = srcAsm_uv[26]; ++ dst0Asm[14] = srcAsm_uv[28]; ++ dst0Asm[15] = srcAsm_uv[30]; ++ ++ dst1Asm[0] = srcAsm_uv[1]; ++ dst1Asm[1] = srcAsm_uv[3]; ++ dst1Asm[2] = srcAsm_uv[5]; ++ dst1Asm[3] = srcAsm_uv[7]; ++ dst1Asm[4] = srcAsm_uv[9]; ++ dst1Asm[5] = srcAsm_uv[11]; ++ dst1Asm[6] = srcAsm_uv[13]; ++ dst1Asm[7] = srcAsm_uv[15]; ++ ++ dst1Asm[8] = srcAsm_uv[17]; ++ dst1Asm[9] = srcAsm_uv[19]; ++ dst1Asm[10] = srcAsm_uv[21]; ++ dst1Asm[11] = srcAsm_uv[23]; ++ dst1Asm[12] = srcAsm_uv[25]; ++ dst1Asm[13] = srcAsm_uv[27]; ++ dst1Asm[14] = srcAsm_uv[29]; ++ dst1Asm[15] = srcAsm_uv[31]; ++ ++ ptr_uv += 32; ++ } ++ ptr += 32; ++ } ++ } ++ ++ if (nWidthMatchFlag != 1) ++ { ++ for (m = 0; m < 32; m++) ++ { ++ if (((i << 5) + m) >= nHeight)// * 32 ++ { ++ ptr += 32; ++ continue; ++ } ++ dstAsm = bufferY; ++ srcAsm = ptr; ++ lineNum = (i << 5) + m; //line num * 32 ++ offset = lineNum * nLineStride + (j << 5);// * 32 ++ ++ memcpy(dstAsm, srcAsm, 32); ++ ptr += 32; ++ for (k = 0; k < 32; k++) ++ { ++ if ((j * 32 + k) >= nLineStride) ++ { ++ break; ++ } ++ pDst[offset + k] = bufferY[k]; ++ } ++ } ++ } ++ ++ if (bCnt2) { ++ if (nWidthMatchFlag_uv != 1) ++ { ++ for (m = 0; m < 32; m++) ++ { ++ if (((i << 4) + m) >= nHeight_uv)//i / 2 * 32 ++ { ++ ptr_uv += 32; ++ continue; ++ } ++ ++ srcAsm_uv = ptr_uv; ++ lineNum_uv = (i << 4) + m; //line num i / 2 * 32 ++ offset = lineNum_uv * nLineStride_uv + (j << 4);// * 16 ++ dst0Asm = bufferU; ++ dst1Asm = bufferV; ++ ++ //memcpy(dst0Asm, srcAsm, 16); ++ //memcpy(dst1Asm, (char *)(srcAsm + 16), 16); ++ dst0Asm[0] = srcAsm_uv[0]; ++ dst0Asm[1] = srcAsm_uv[2]; ++ dst0Asm[2] = srcAsm_uv[4]; ++ dst0Asm[3] = srcAsm_uv[6]; ++ dst0Asm[4] = srcAsm_uv[8]; ++ dst0Asm[5] = srcAsm_uv[10]; ++ dst0Asm[6] = srcAsm_uv[12]; ++ dst0Asm[7] = srcAsm_uv[14]; ++ ++ dst0Asm[8] = srcAsm_uv[16]; ++ dst0Asm[9] = srcAsm_uv[18]; ++ dst0Asm[10] = srcAsm_uv[20]; ++ dst0Asm[11] = srcAsm_uv[22]; ++ dst0Asm[12] = srcAsm_uv[24]; ++ dst0Asm[13] = srcAsm_uv[26]; ++ dst0Asm[14] = srcAsm_uv[28]; ++ dst0Asm[15] = srcAsm_uv[30]; ++ ++ dst1Asm[0] = srcAsm_uv[1]; ++ dst1Asm[1] = srcAsm_uv[3]; ++ dst1Asm[2] = srcAsm_uv[5]; ++ dst1Asm[3] = srcAsm_uv[7]; ++ dst1Asm[4] = srcAsm_uv[9]; ++ dst1Asm[5] = srcAsm_uv[11]; ++ dst1Asm[6] = srcAsm_uv[13]; ++ dst1Asm[7] = srcAsm_uv[15]; ++ ++ dst1Asm[8] = srcAsm_uv[17]; ++ dst1Asm[9] = srcAsm_uv[19]; ++ dst1Asm[10] = srcAsm_uv[21]; ++ dst1Asm[11] = srcAsm_uv[23]; ++ dst1Asm[12] = srcAsm_uv[25]; ++ dst1Asm[13] = srcAsm_uv[27]; ++ dst1Asm[14] = srcAsm_uv[29]; ++ dst1Asm[15] = srcAsm_uv[31]; ++ ptr_uv += 32; ++ ++ for (k = 0; k < 16; k++) ++ { ++ if (((j << 4) + k) >= nLineStride_uv)// j * 16 ++ { ++ break; ++ } ++ pDstV[offset + k] = bufferV[k]; ++ pDstU[offset + k] = bufferU[k]; ++ } ++ } ++ } ++ } ++ bCnt2 = !bCnt2; ++ } ++} ++ + void ConvertPixelFormat(VideoPicture* pPictureIn, VideoPicture* pPictureOut) + { + int nMemSizeY = 0; +@@ -584,6 +837,11 @@ void ConvertPixelFormat(VideoPicture* pPictureIn, VideoPicture* pPictureOut) + + if(pPictureOut->ePixelFormat==PIXEL_FORMAT_YV12) + { ++ if(pPictureIn->ePixelFormat == PIXEL_FORMAT_YUV_MB32_420) ++ { ++ MB32_CVT_YV12(pPictureIn->pData0, pPictureIn->pData1, pPictureOut->pData0, \ ++ pPictureIn->nWidth, pPictureIn->nHeight); ++ } + #ifdef CEDARX_DECODER_ARM32 + if(pPictureIn->ePixelFormat == PIXEL_FORMAT_YUV_MB32_420) + { +-- +2.34.1 + diff --git a/package/libcedarc/Config.in b/package/libcedarc/Config.in new file mode 100644 index 00000000..45ffcd00 --- /dev/null +++ b/package/libcedarc/Config.in @@ -0,0 +1,106 @@ +menuconfig BR2_PACKAGE_LIBCEDARC + bool "libcedarc" + help + Allwinner Cedar Video Engine Library + +if BR2_PACKAGE_LIBCEDARC + +config BR2_PACKAGE_LIBCEDARC_ARCHLIB + string "Arch library select" + default "arm-linux-gnueabihf" + help + akk44_32 + anou70_32 + alp50_32 + alp50_64 + amm60_32 + amm60_64 + aore80_32 + arm-none-linux-gnueabi + arm-linux-gnueabi + arm-linux-gnueabihf + toolchain-sunxi-arm-glibc + toolchain-sunxi-arm-musl + toolchain-sunxi-aarch64-glibc + toolchain-sunxi-aarch64-musl + toolchain-sunxi-arm9-glibc + toolchain-sunxi-arm9-musl + +config BR2_PACKAGE_LIBCEDARC_ENCODER + bool "Encoder support" + default y + help + Enable MJPEG / H.264 / H.265 encoder + +menuconfig BR2_PACKAGE_LIBCEDARC_DECODER + bool "Decoder support" + help + Allwinner Cedar Video Engine Decoder library + +if BR2_PACKAGE_LIBCEDARC_DECODER + +config BR2_PACKAGE_LIBCEDARC_DECODER_AVS + bool "AVS support" + default y + help + Enable AVS decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_H264 + bool "H.264 support" + default y + help + Enable H.264 decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_H265 + bool "H.265 support" + default y + help + Enable H.265 decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_MJPEG + bool "MJPEG support" + default y + help + Enable MJPEG decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_MPEG2 + bool "MPEG2 support" + default y + help + Enable MPEG2 decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_MPEG4 + bool "MPEG4 support" + default y + help + Enable MPEG4 decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_VP8 + bool "VP8 support" + default y + help + Enable VP8 decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_VP9 + bool "VP9 support" + default y + help + Enable VP9 decoder + +config BR2_PACKAGE_LIBCEDARC_DECODER_WMV3 + bool "WMV3 support" + default y + help + Enable WMV3 decoder + +endif + +comment "OpenMax required both encoder & decoder support" + +config BR2_PACKAGE_LIBCEDARC_OPENMAX + bool "OpenMax framework support" + depends on BR2_PACKAGE_LIBCEDARC_DECODER && BR2_PACKAGE_LIBCEDARC_ENCODER + help + Enable OpenMax framework + +endif diff --git a/package/libcedarc/libcedarc.hash b/package/libcedarc/libcedarc.hash new file mode 100644 index 00000000..eed9c3ef --- /dev/null +++ b/package/libcedarc/libcedarc.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 41133d8763bd75380c28e3037d4946508ad6fa84313be8c5051eb6d5256a2aec libcedarc-e4246be521203adb2d93d52482239044a7f9b6fe.tar.gz diff --git a/package/libcedarc/libcedarc.mk b/package/libcedarc/libcedarc.mk new file mode 100644 index 00000000..6f567bef --- /dev/null +++ b/package/libcedarc/libcedarc.mk @@ -0,0 +1,82 @@ +################################################################################ +# +# libcedarc +# +################################################################################ +LIBCEDARC_VERSION = e4246be521203adb2d93d52482239044a7f9b6fe +LIBCEDARC_LICENSE = PROPRIETARY +LIBCEDARC_SITE = $(call github,aodzip,libcedarc,$(LIBCEDARC_VERSION)) +LIBCEDARC_DEPENDENCIES = +LIBCEDARC_INSTALL_STAGING = YES +LIBCEDARC_INSTALL_TARGET = YES +LIBCEDARC_AUTORECONF = YES +LIBCEDARC_ARCHLIB = $(call qstrip,$(BR2_PACKAGE_LIBCEDARC_ARCHLIB)) +LIBCEDARC_CONF_ENV = \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(@D)/library/$(LIBCEDARC_ARCHLIB)" +LIBCEDARC_CONF_OPTS = + +LIBCEDARC_INSTALL_STAGING_CMDS = $(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) install; + +LIBCEDARC_INSTALL_STAGING_CMDS += cp $(@D)/include/* '$(STAGING_DIR)/usr/include/'; + +ifeq ($(BR2_PACKAGE_LIBCEDARC_OPENMAX),y) +LIBCEDARC_INSTALL_STAGING_CMDS += cp $(@D)/openmax/include/* '$(STAGING_DIR)/usr/include/'; +endif + +LIBCEDARC_INSTALL_TARGET_CMDS = $(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install; +LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libVE.so' '$(TARGET_DIR)/usr/lib/'; +LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libvideoengine.so' '$(TARGET_DIR)/usr/lib/'; + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_AVS),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawavs.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_H264),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawh264.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_H265),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawh265.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_MJPEG),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmjpeg.so' '$(TARGET_DIR)/usr/lib/'; + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmjpegplus.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_MPEG2),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg2.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_MPEG4),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4base.so' '$(TARGET_DIR)/usr/lib/'; + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4dx.so' '$(TARGET_DIR)/usr/lib/'; + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4h263.so' '$(TARGET_DIR)/usr/lib/'; + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4normal.so' '$(TARGET_DIR)/usr/lib/'; + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawmpeg4vp6.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_VP8),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawvp8.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_VP9),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawvp9Hw.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_DECODER_WMV3),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libawwmv3.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifeq ($(BR2_PACKAGE_LIBCEDARC_ENCODER),y) + LIBCEDARC_INSTALL_TARGET_CMDS += cp '$(@D)/library/$(LIBCEDARC_ARCHLIB)/libvencoder.so' '$(TARGET_DIR)/usr/lib/'; +endif + +ifneq ($(BR2_PACKAGE_LIBCEDARC_OPENMAX),y) + LIBCEDARC_INSTALL_TARGET_CMDS += rm '$(TARGET_DIR)/usr/lib/libOmxCore.so'; + LIBCEDARC_INSTALL_TARGET_CMDS += rm '$(TARGET_DIR)/usr/lib/libOmxVdec.so'; + LIBCEDARC_INSTALL_TARGET_CMDS += rm '$(TARGET_DIR)/usr/lib/libOmxVenc.so'; +endif + +$(eval $(autotools-package))