This adds a flag for hardware acceleration so that a canvas defaults
to software rendering and can be explicitly asked to use hardware
acceleration whenever needed.
We also make sure to store the canvas-id (a property of the canvas
object) to uniquely pair PaleCanvas with its own canvas object.
We also add a frame_rate field so that we can change each canvas'
frame rate individually.
We also initialize and store pixel_data in PaleCanvas which stores raw
ARGB32 pixel data, the same format that Canvas API requires.
Since we now allow different canvases to have different frame rates,
we must always have the frame rate of the video canvas to be inherited
from the video's natural frame rate. We call `ffprobe` for this.
We also remove helper functions that have been moved to elisp-helpers
emacs_pale_create_canvas: This module function takes dimensions and
the canvas-id and initializes a PaleCanvas and returns it as a
user-ptr.
emacs_pale_refresh_canvas: Refreshes the canvas using the module API function.
Fetch PaleCanvas with get_canvas_handle.
Fetch video_player_t with make_video_handle and put the user ptr at
`:pale-video-player' property.
Store the frame rate also as a property :pale-frame-rate in the canvas object.
By default it simply converts the RGB24 from ffmpeg to ARGB32 and then
stores it at PaleCanvas' pixel_data.
Also returns the RGB24 buffer so that it can be used for the next frame
Fetches PaleCanvas with get_canvas_handle.
After calling pale_video_update_frame then copies the memory of
PaleCanvas' pixel_data to the canvas'canvas_pixel. And then calls
canvas_refresh.
The updated Canvas API doesn't need us to track them
Since we no longer poll for tiled PPMs, we do not need them.
Now pale-create-canvas will create a canvas object, hook it up with
its unique PaleCanvas on the dynamic module side and properly add the
required additional properties for user-ptr and frame-rate.
We'll add new primitives based on the new rendering API
Also uses the new module function to refresh. Since the new Canvas API
doesn't have a canvas-refresh function exposed to Lisp.
It now takes the canvas as an argument, and then creates a player
user-ptr and then calls the pale--dyn-video-play function with that.
It runs a timer with the frame-rate as provided by the video, and then
stores both the timer and the canvas in `pale--active-canvases'.