mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
				synced 2023-10-10 17:16:51 +00:00 
			
		
		
		
	Jpeg screengrab use VDR RgbToJpeg function.
This commit is contained in:
		| @@ -1,5 +1,10 @@ | ||||
| User m.Rcu | ||||
| Date: Sun Feb 12 20:28:22 CET 2012 | ||||
|  | ||||
|     Jpeg screengrab use VDR RgbToJpeg function. | ||||
|  | ||||
| User johns | ||||
| Date: | ||||
| Date: Sun Feb 12 20:14:43 CET 2012 | ||||
|  | ||||
|     Add play/pause audio support. | ||||
|     Fix bug: audible glitch when switching AC-3 pass-through <-> none. | ||||
|   | ||||
							
								
								
									
										32
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								Makefile
									
									
									
									
									
								
							| @@ -24,15 +24,15 @@ CONFIG += -DAV_INFO | ||||
| CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU") | ||||
| CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI") | ||||
| CONFIG += $(shell pkg-config --exists alsa && echo "-DUSE_ALSA") | ||||
| CONFIG += $(shell ls /usr/lib/libjpeg* >/dev/null 2>&1 && echo "-DUSE_JPEG") | ||||
| CONFIG += -DUSE_OSS | ||||
|  | ||||
| ### The C++ compiler and options: | ||||
|  | ||||
| CC       ?= gcc | ||||
| CXX      ?= g++ | ||||
| CFLAGS   ?=	-g -O2 -W -Wall -Wextra -Winit-self \ | ||||
| 		-Wdeclaration-after-statement | ||||
| CC	 ?= gcc | ||||
| CXX	 ?= g++ | ||||
| CFLAGS	 ?=	-g -O2 -W -Wall -Wextra -Winit-self \ | ||||
| 		-Wdeclaration-after-statement \ | ||||
| 		-ftree-vectorize -msse3 -flax-vector-conversions | ||||
| CXXFLAGS ?= -g -O2 -W -Wall -Wextra -Woverloaded-virtual | ||||
|  | ||||
| ### The directory environment: | ||||
| @@ -71,15 +71,15 @@ _CFLAGS = $(DEFINES) $(INCLUDES) \ | ||||
| 		xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\ | ||||
| 	`pkg-config --cflags gl glu` \ | ||||
| 	$(if $(findstring USE_VDPAU,$(CONFIG)), \ | ||||
| 	            `pkg-config --cflags vdpau`) \ | ||||
| 		    `pkg-config --cflags vdpau`) \ | ||||
| 	$(if $(findstring USE_VAAPI,$(CONFIG)), \ | ||||
| 	            `pkg-config --cflags libva-x11 libva-glx libva`) \ | ||||
| 		    `pkg-config --cflags libva-x11 libva-glx libva`) \ | ||||
| 	$(if $(findstring USE_ALSA,$(CONFIG)), \ | ||||
| 	            `pkg-config --cflags alsa`) | ||||
| 		    `pkg-config --cflags alsa`) | ||||
|  | ||||
| #override _CFLAGS  += -Werror | ||||
| override CXXFLAGS += $(_CFLAGS) | ||||
| override CFLAGS   += $(_CFLAGS) | ||||
| override CFLAGS	  += $(_CFLAGS) | ||||
|  | ||||
| LIBS += -lrt \ | ||||
| 	$(shell pkg-config --libs libavcodec libavformat) \ | ||||
| @@ -87,13 +87,11 @@ LIBS += -lrt \ | ||||
| 		xcb-screensaver xcb-randr xcb-glx xcb-icccm xcb-keysyms`\ | ||||
| 	`pkg-config --libs gl glu` \ | ||||
| 	$(if $(findstring USE_VDPAU,$(CONFIG)), \ | ||||
| 	            `pkg-config --libs vdpau`) \ | ||||
| 		    `pkg-config --libs vdpau`) \ | ||||
| 	$(if $(findstring USE_VAAPI,$(CONFIG)), \ | ||||
| 	            `pkg-config --libs libva-x11 libva-glx libva`) \ | ||||
| 		    `pkg-config --libs libva-x11 libva-glx libva`) \ | ||||
| 	$(if $(findstring USE_ALSA,$(CONFIG)), \ | ||||
| 	            `pkg-config --libs alsa`) \ | ||||
| 	$(if $(findstring USE_JPEG,$(CONFIG)), \ | ||||
| 	            -ljpeg) | ||||
| 		    `pkg-config --libs alsa`) | ||||
|  | ||||
| ### The object files (add further files here): | ||||
|  | ||||
| @@ -122,11 +120,11 @@ $(OBJS): Makefile | ||||
|  | ||||
| ### Internationalization (I18N): | ||||
|  | ||||
| PODIR     = po | ||||
| PODIR	  = po | ||||
| LOCALEDIR = $(VDRDIR)/locale | ||||
| I18Npo    = $(wildcard $(PODIR)/*.po) | ||||
| I18Npo	  = $(wildcard $(PODIR)/*.po) | ||||
| I18Nmsgs  = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) | ||||
| I18Npot   = $(PODIR)/$(PLUGIN).pot | ||||
| I18Npot	  = $(PODIR)/$(PLUGIN).pot | ||||
|  | ||||
| %.mo: %.po | ||||
| 	msgfmt -c -o $@ $< | ||||
|   | ||||
							
								
								
									
										20
									
								
								softhddev.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								softhddev.c
									
									
									
									
									
								
							| @@ -39,9 +39,6 @@ | ||||
| #define __USE_GNU | ||||
| #endif | ||||
| #include <pthread.h> | ||||
| #ifdef USE_JPEG | ||||
| #include <jpeglib.h> | ||||
| #endif | ||||
|  | ||||
| #include "misc.h" | ||||
| #include "softhddev.h" | ||||
| @@ -1013,6 +1010,9 @@ int PlayVideo(const uint8_t * data, int size) | ||||
| #endif | ||||
| } | ||||
|  | ||||
|     /// call VDR support function | ||||
| extern uint8_t *CreateJpeg(uint8_t *, int *, int, int, int); | ||||
|  | ||||
| #if defined(USE_JPEG) && JPEG_LIB_VERSION >= 80 | ||||
|  | ||||
| /** | ||||
| @@ -1079,21 +1079,15 @@ uint8_t *CreateJpeg(uint8_t * image, int raw_size, int *size, int quality, | ||||
| uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height) | ||||
| { | ||||
|     if (jpeg) { | ||||
| #if defined(USE_JPEG) && JPEG_LIB_VERSION >= 80 | ||||
| 	int raw_size; | ||||
| 	uint8_t *image; | ||||
| 	uint8_t *jpg_image; | ||||
| 	uint8_t *image; | ||||
| 	int raw_size = 0; | ||||
|  | ||||
| 	raw_size = 0; | ||||
| 	image = VideoGrab(&raw_size, &width, &height, 0); | ||||
| 	jpg_image = CreateJpeg(image, raw_size, size, quality, width, height); | ||||
| 	jpg_image = CreateJpeg(image, size, quality, width, height); | ||||
|  | ||||
| 	free(image); | ||||
| 	return jpg_image; | ||||
| #else | ||||
| 	(void)quality; | ||||
| 	Error(_("softhddev: jpeg grabbing not supported\n")); | ||||
| 	return NULL; | ||||
| #endif | ||||
|     } | ||||
|     if (width != -1 && height != -1) { | ||||
| 	Warning(_("softhddev: scaling unsupported\n")); | ||||
|   | ||||
| @@ -886,17 +886,17 @@ bool cSoftHdDevice::Flush(int timeout_ms) | ||||
| **	Sets the video display format to the given one (only useful if this | ||||
| **	device has an MPEG decoder). | ||||
| ** | ||||
| **	@note FIXME: this function isn't called on the initial channel | ||||
| **	@note this function isn't called on the initial channel | ||||
| */ | ||||
| void cSoftHdDevice::SetVideoDisplayFormat( | ||||
|     eVideoDisplayFormat video_display_format) | ||||
| { | ||||
|     static int last = -1; | ||||
|  | ||||
|     cDevice::SetVideoDisplayFormat(video_display_format); | ||||
|  | ||||
|     dsyslog("[softhddev]%s: %d\n", __FUNCTION__, video_display_format); | ||||
|  | ||||
|     cDevice::SetVideoDisplayFormat(video_display_format); | ||||
|  | ||||
|     // called on every channel switch, no need to kill osd... | ||||
|     if (last != video_display_format) { | ||||
| 	last = video_display_format; | ||||
| @@ -1033,6 +1033,16 @@ uchar *cSoftHdDevice::GrabImage(int &size, bool jpeg, int quality, int width, | ||||
|     return::GrabImage(&size, jpeg, quality, width, height); | ||||
| } | ||||
|  | ||||
| /** | ||||
| **	Call rgb to jpeg for C Plugin. | ||||
| */ | ||||
| extern "C" uint8_t * CreateJpeg(uint8_t * image, int *size, int quality, | ||||
|     int width, int height) | ||||
| { | ||||
|     return (uint8_t *) RgbToJpeg((uchar *) image, width, height, *size, | ||||
| 	quality); | ||||
| } | ||||
|  | ||||
| ////////////////////////////////////////////////////////////////////////////// | ||||
| //	cPlugin | ||||
| ////////////////////////////////////////////////////////////////////////////// | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 m.Rcu
					m.Rcu