Skip to content

Commit

Permalink
Merge branch 'vdec_0703' into 'dev'
Browse files Browse the repository at this point in the history
modify vdec and vo

See merge request maix_sw/k230_canmv!273
  • Loading branch information
gh-sxp committed Jul 3, 2024
2 parents 0afbae0 + f5ebc7a commit 13bbd92
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
Binary file removed k230_sdk_overlay/src/big/mpp/kernel/lib/libvpu.a
Binary file not shown.
10 changes: 8 additions & 2 deletions micropython/port/builtin_py/media/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def __del__(self):
# flag
@classmethod
def bind_layer(cls, **kwargs):
if cls._is_inited:
raise AssertionError("please run Display.bind_layer() before Display.init()")
# if cls._is_inited:
# raise AssertionError("please run Display.bind_layer() before Display.init()")

src = kwargs.get('src', None)
if src is None:
Expand Down Expand Up @@ -155,6 +155,12 @@ def bind_layer(cls, **kwargs):
layer_config = Display.LayerConfig(layer, rect, pix_format, flag, alpha)
cls._layer_bind_cfg[layer] = Display.BindConfig(src, dst, layer_config)

if cls._is_inited:
if (Display.LAYER_VIDEO1 <= layer <= Display.LAYER_VIDEO2):
cls.__config_video_layer(layer_config)
elif (Display.LAYER_OSD0 <= i <= Display.LAYER_OSD3):
cls.__config_osd_layer(layer_config)

@classmethod
def unbind_layer(cls, layer):
if isinstance(cls._layer_bind_cfg[chn], Display.BindConfig):
Expand Down
14 changes: 7 additions & 7 deletions micropython/port/builtin_py/media/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ def _init_media_buffer(self):
self.pyaudio = PyAudio()
self.pyaudio.initialize(48000//25)

bind_info = self.vdec.bind_info(width=self.video_info.width,height=self.video_info.height,chn=vdecoder.Decoder.get_free_chn_index())
#bind_info = self.vdec.bind_info(width=self.video_info.width,height=self.video_info.height,chn=self.vdec.get_vdec_channel())
Display.bind_layer(**bind_info, layer = Display.LAYER_VIDEO1)
Display.init(Display.LT9611)

Display.init(Display.LT9611)
MediaManager.init() #vb buffer初始化

if (self.audio_track):
self.adec.create()

if (self.video_track):
self.vdec.create()

bind_info = self.vdec.bind_info(width=self.video_info.width,height=self.video_info.height,chn=self.vdec.get_vdec_channel())
Display.bind_layer(**bind_info, layer = Display.LAYER_VIDEO1)

if (self.audio_track):
self.adec.create()


def _deinit_media_buffer(self):
if (self.video_track):
Expand Down

0 comments on commit 13bbd92

Please sign in to comment.