Bridgetek / pico-brteve

Example code and utility to make Raspberry Pi/Raspberry Pi Pico work with Eve GPU from BridgeTek. https://brtchip.com/eve/
MIT License
8 stars 5 forks source link

Add a new example project for video playback #6

Closed BRTSG-FOSS closed 2 years ago

BRTSG-FOSS commented 2 years ago

refer to https://github.com/jamesbowman/py-bteve/blob/master/examples/video.py and add a video playback example using MediaPlayer class

BRTSG-FOSS commented 2 years ago

Add volume control:

    gd.wr8(gd.REG_VOL_PB,0xFF)  #volume control for output
    gd.wr8(gd.REG_GPIOX_DIR,0xFF) 
    gd.wr8(gd.REG_GPIOX,0xFF) #volume switch for speaker
    while 1:
        for fn in ["trailer_400p.avi"]:
            with open(D + fn, "rb") as f:
                mp = MoviePlayer(gd,f)
                mp.play()

Add OPT_SOUND in play method:


class MoviePlayer:
    """ Helper class to play movie with EVE"""
    def __init__(self, eve, file_handler, mf_base=const(0xF0000), mf_size=const(0x8000)):
    """""""

    def play(self):
        """ Start playback a movie"""
        eve = self.eve
        eve.cmd_playvideo(eve.OPT_MEDIAFIFO | eve.OPT_FULLSCREEN | eve.OPT_NOTEAR | eve.OPT_SOUND)
BRTSG-FOSS commented 2 years ago

image

change from wr to write_mem

brtchip-tuannguyen commented 2 years ago

The video layback example is done in commit f886a91 Please have a look and try