diff --git a/design/codec_hdi/codec_hdi_refactor/codec_hdi_refactor-V2.0.md b/design/codec_hdi/codec_hdi_refactor/codec_hdi_refactor-V2.0.md index bcb0fa679fc1809db665e024f173d486b2465c26..57c03b4394209a6384f0cc730dc96462ce8780d2 100644 --- a/design/codec_hdi/codec_hdi_refactor/codec_hdi_refactor-V2.0.md +++ b/design/codec_hdi/codec_hdi_refactor/codec_hdi_refactor-V2.0.md @@ -49,6 +49,33 @@ HdiAdapter -> Hdi:打开端口 HdiAdapter -> Hdi:所有buffer向下传递 HdiAdapter -> Hdi:等待打开端口事件完成 ``` + +### 分辨率改变时序图 2.0: +实际的代码实现逻辑如下: +其中,分辨率改变事件需要上报 2 次的原因是:如果不阻塞filter的DecodeFrame()线程,hdi释放buffer后,surfaceBuffer会自动归还,这时,DecodeFrame()线程会自动获取surfaceBuffer并往插件push;会影响omxBuffer的释放; +``` plantuml +participant HdiInterface +participant HdiCodecAdapter +participant VideoDecodeFilter + +HdiInterface -> HdiCodecAdapter:事件触发 +HdiCodecAdapter -> HdiInterface:获取端口参数,\n后续会根据这些参数重新配置端口和buffer个数 +HdiCodecAdapter -> VideoDecodeFilter:分辨率改变事件上报,\n带上端口参数\n这里可以不上报,直接弄个成员作为标志位,\nQueueOutputBuffer()的时候,在这里等待; +VideoDecodeFilter -> VideoDecodeFilter:1.通过上报分辨率改变事件pause相关线程\n阻塞QueueOutputBuffer(),\n保证不调用FillAllTheOutBuffer() +HdiCodecAdapter -> HdiInterface:关闭端口 +HdiCodecAdapter -> HdiCodecAdapter:等待所有buffer归还,端口关闭完成 +HdiCodecAdapter -> HdiInterface:解除pluginBuffer和omxBuffer的绑定,\n并将两者都释放 +HdiCodecAdapter -> HdiInterface:根据端口参数中的宽、高,\n是否有变化来决定是否需要重新配置端口 +HdiCodecAdapter -> HdiInterface:重启端口 +HdiCodecAdapter -> VideoDecodeFilter:分辨率改变事件再次上报, +VideoDecodeFilter -> VideoDecodeFilter:2.根据端口参数是否改变,决定是否需要重新申请内存,\n重新分配outBufPool +VideoDecodeFilter -> HdiCodecAdapter : 向下传递所有buffer +HdiCodecAdapter -> HdiCodecAdapter:将pluginBuffer和omxBuffer绑定 +HdiCodecAdapter -> HdiInterface:所有omxBuffer向下传递 +HdiCodecAdapter -> VideoDecodeFilter:分辨率改变事件第三次上报, +VideoDecodeFilter -> VideoDecodeFilter:3.取消QueueOutputBuffer()阻塞 +``` + ## 重构的设计思路 首先,从整体上讲,它是一个实现了CodecPlugin接口的插件。 diff --git "a/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/3516\347\203\247\345\275\225&\346\265\213\350\257\225\346\226\207\346\241\243.rar" "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/3516\347\203\247\345\275\225&\346\265\213\350\257\225\346\226\207\346\241\243.rar" new file mode 100644 index 0000000000000000000000000000000000000000..b760e73ee73f97a0d64753c915f8828f8931c3df Binary files /dev/null and "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/3516\347\203\247\345\275\225&\346\265\213\350\257\225\346\226\207\346\241\243.rar" differ diff --git "a/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/H264\347\240\201\346\265\201\345\210\206\346\236\220\345\267\245\345\205\267-SpecialVH264.exe" "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/H264\347\240\201\346\265\201\345\210\206\346\236\220\345\267\245\345\205\267-SpecialVH264.exe" new file mode 100644 index 0000000000000000000000000000000000000000..420c30d30ef5121afb82eb19fc0d5316167373c5 Binary files /dev/null and "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/H264\347\240\201\346\265\201\345\210\206\346\236\220\345\267\245\345\205\267-SpecialVH264.exe" differ diff --git "a/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223.doc" "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223.doc" new file mode 100644 index 0000000000000000000000000000000000000000..c5789bf662a9a80785ad11efdff3031a9d2bf43a Binary files /dev/null and "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223.doc" differ diff --git "a/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/push_so_into_rk.bat" "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/push_so_into_rk.bat" new file mode 100644 index 0000000000000000000000000000000000000000..be70ed0ca6c6d485cce625a19d955a8ddaaaa252 --- /dev/null +++ "b/histreamer-\351\241\271\347\233\256\346\200\273\347\273\223/push_so_into_rk.bat" @@ -0,0 +1,47 @@ +@rem Function description: +@rem copy compiled so to histreamer_so directory and push to device. + +@rem BTW, build histreamer command: +@rem ./build.sh --product-name rk3568 --ccache --build-target multimedia_histreamer + +@rem ●●● Modify this path first: +set OH_SRC_ROOT=cwx1134798@123.60.114.127:~/OpenHarmony_rk3568_0707/ohCode/ + +@rem local so path +set LOCAL_SO_PATH=multimedia_histreamer + +@rem remove old so +rd /s /Q %LOCAL_SO_PATH% + +scp -r -P 2222 %OH_SRC_ROOT%/out/rk3568/multimedia/histreamer multimedia_histreamer + + +hdc wait-for-device shell mount -o remount,rw / + +for %%i in (%LOCAL_SO_PATH%\*.so) do ( + if %%i==%LOCAL_SO_PATH%\libmedia_engine_histreamer.z.so ( + hdc file send %%i /system/lib/media + ) else if %%i==%LOCAL_SO_PATH%\libhistreamer_engine_filters.z.so ( + hdc file send %%i /system/lib + ) else if %%i==%LOCAL_SO_PATH%\libhistreamer_base.z.so ( + hdc file send %%i /system/lib + ) else if %%i==%LOCAL_SO_PATH%\libhistreamer_plugin_base.z.so ( + hdc file send %%i /system/lib + ) else if %%i==%LOCAL_SO_PATH%\libhistreamer_codec_filters.z.so ( + hdc file send %%i /system/lib + ) else if %%i==%LOCAL_SO_PATH%\libhistreamer_ffmpeg_convert.z.so ( + hdc file send %%i /system/lib + ) else ( + hdc file send %%i /system/lib/media/histreamer_plugins + ) +) + +@echo. +@echo Press enter to reboot device and exit this script. + +pause + +hdc shell reboot + + +ssh -p "chw123" ssh cwx1134798@123.60.114.127 -p 2222 -A