Skip to content

Commit ea0c700

Browse files
6by9popcornmix
authored andcommitted
staging: vc04_services: Add a V4L2 M2M codec driver
This adds a V4L2 memory to memory device that wraps the MMAL video decode and video_encode components for H264 and MJPEG encode and decode, MPEG4, H263, and VP8 decode (and MPEG2 decode if the appropriate licence has been purchased). This patch squashes all the work done in developing the driver on the Raspberry Pi rpi-5.4.y kernel branch. Thanks to Kieran Bingham, Aman Gupta, Chen-Yu Tsai, and Marek Behún for their contributions. Please refer to the rpi-5.4.y branch for the full history. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 72594ed commit ea0c700

File tree

7 files changed

+4055
-0
lines changed

7 files changed

+4055
-0
lines changed

drivers/platform/raspberrypi/vchiq-mmal/mmal-parameters.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ enum mmal_parameter_camera_type {
281281
MMAL_PARAMETER_GAMMA,
282282
/**< Takes a @ref MMAL_PARAMETER_CDN_T */
283283
MMAL_PARAMETER_CDN,
284+
/**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
285+
MMAL_PARAMETER_JPEG_IJG_SCALING,
284286
};
285287

286288
enum mmal_parameter_camera_config_timestamp_mode {
@@ -676,6 +678,12 @@ enum mmal_parameter_video_type {
676678

677679
/**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
678680
MMAL_PARAMETER_VIDEO_ENCODE_HEADERS_WITH_FRAME,
681+
682+
/**< Take a @ref MMAL_PARAMETER_BOOLEAN_T */
683+
MMAL_PARAMETER_VIDEO_VALIDATE_TIMESTAMPS,
684+
685+
/**< Takes a @ref MMAL_PARAMETER_BOOLEAN_T */
686+
MMAL_PARAMETER_VIDEO_STOP_ON_PAR_COLOUR_CHANGE,
679687
};
680688

681689
/** Valid mirror modes */

drivers/staging/vc04_services/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ if BCM_VIDEOCORE
33

44
source "drivers/staging/vc04_services/bcm2835-audio/Kconfig"
55
source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
6+
source "drivers/staging/vc04_services/bcm2835-codec/Kconfig"
67

78
endif
89

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_SND_BCM2835) += bcm2835-audio/
33
obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/
4+
obj-$(CONFIG_VIDEO_CODEC_BCM2835) += bcm2835-codec/
45

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
config VIDEO_CODEC_BCM2835
2+
tristate "BCM2835 Video codec support"
3+
depends on MEDIA_SUPPORT && MEDIA_CONTROLLER
4+
depends on VIDEO_DEV && (ARCH_BCM2835 || COMPILE_TEST)
5+
select BCM2835_VCHIQ_MMAL
6+
select VIDEOBUF2_DMA_CONTIG
7+
select V4L2_MEM2MEM_DEV
8+
help
9+
Say Y here to enable the V4L2 video codecs for
10+
Broadcom BCM2835 SoC. This operates over the VCHIQ interface
11+
to a service running on VideoCore.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
bcm2835-codec-objs := bcm2835-v4l2-codec.o
3+
4+
obj-$(CONFIG_VIDEO_CODEC_BCM2835) += bcm2835-codec.o
5+
6+
ccflags-y += \
7+
-D__VCCOREVER__=0x04000000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
No issues. Depends on VCHIQ which is in staging.

0 commit comments

Comments
 (0)