mirror of
				https://github.com/jojo61/vdr-plugin-softhdcuvid.git
				synced 2025-03-01 10:39:28 +00:00 
			
		
		
		
	Merge pull request #16 from dnehring7/master
Fix remaining indentation problems.
This commit is contained in:
		
							
								
								
									
										1
									
								
								codec.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								codec.c
									
									
									
									
									
								
							| @@ -1,4 +1,3 @@ | |||||||
|  |  | ||||||
| /// | /// | ||||||
| /// @file codec.c   @brief Codec functions | /// @file codec.c   @brief Codec functions | ||||||
| /// | /// | ||||||
|   | |||||||
| @@ -1,4 +1,3 @@ | |||||||
|  |  | ||||||
| // shader | // shader | ||||||
| #ifdef CUVID | #ifdef CUVID | ||||||
| char vertex_osd[] = { "\ | char vertex_osd[] = { "\ | ||||||
|   | |||||||
| @@ -89,4 +89,3 @@ color.a = 1.0; | |||||||
| // color mapping | // color mapping | ||||||
| out_color = color; | out_color = color; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -55,13 +55,6 @@ extern "C" | |||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  |  | ||||||
| #if APIVERSNUM >= 20301 |  | ||||||
| #define MURKS -> |  | ||||||
| #else |  | ||||||
| #define MURKS . |  | ||||||
| #define LOCK_CHANNELS_READ	do { } while (0) |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| ////////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////////// | ||||||
|  |  | ||||||
| /// vdr-plugin version number. | /// vdr-plugin version number. | ||||||
| @@ -384,7 +377,7 @@ cSoftOsd::~cSoftOsd(void) | |||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
| +*	Set the sub-areas to the given areas | **  Set the sub-areas to the given areas | ||||||
| */ | */ | ||||||
| eOsdError cSoftOsd::SetAreas(const tArea * areas, int n) | eOsdError cSoftOsd::SetAreas(const tArea * areas, int n) | ||||||
| { | { | ||||||
| @@ -616,11 +609,7 @@ void cSoftOsd::Flush(void) | |||||||
| #endif | #endif | ||||||
|         OsdDrawARGB(xp, yp, w, h, stride, pm->Data(), x, y); |         OsdDrawARGB(xp, yp, w, h, stride, pm->Data(), x, y); | ||||||
|  |  | ||||||
| #if APIVERSNUM >= 20110 |  | ||||||
|         DestroyPixmap(pm); |         DestroyPixmap(pm); | ||||||
| #else |  | ||||||
|         delete pm; |  | ||||||
| #endif |  | ||||||
|     } |     } | ||||||
|     Dirty = 0; |     Dirty = 0; | ||||||
| } | } | ||||||
| @@ -1741,11 +1730,7 @@ class cSoftReceiver:public cReceiver | |||||||
| { | { | ||||||
|   protected: |   protected: | ||||||
|     virtual void Activate(bool); |     virtual void Activate(bool); | ||||||
| #if APIVERSNUM >= 20301 |  | ||||||
|     virtual void Receive(const uchar *, int); |     virtual void Receive(const uchar *, int); | ||||||
| #else |  | ||||||
|     virtual void Receive(uchar *, int); |  | ||||||
| #endif |  | ||||||
|   public: |   public: | ||||||
|      cSoftReceiver(const cChannel *);   ///< receiver constructor |      cSoftReceiver(const cChannel *);   ///< receiver constructor | ||||||
|      virtual ~ cSoftReceiver();         ///< receiver destructor |      virtual ~ cSoftReceiver();         ///< receiver destructor | ||||||
| @@ -1868,11 +1853,7 @@ static void PipPesParse(const uint8_t * data, int size, int is_start) | |||||||
| **  @param data ts packet | **  @param data ts packet | ||||||
| **  @param size size (#TS_PACKET_SIZE=188) of tes packet | **  @param size size (#TS_PACKET_SIZE=188) of tes packet | ||||||
| */ | */ | ||||||
| #if APIVERSNUM >= 20301 |  | ||||||
| void cSoftReceiver::Receive(const uchar * data, int size) | void cSoftReceiver::Receive(const uchar * data, int size) | ||||||
| #else |  | ||||||
| void cSoftReceiver::Receive(uchar * data, int size) |  | ||||||
| #endif |  | ||||||
| { | { | ||||||
|     const uint8_t *p; |     const uint8_t *p; | ||||||
|  |  | ||||||
| @@ -1964,7 +1945,7 @@ static void NewPip(int channel_nr) | |||||||
|         channel_nr = cDevice::CurrentChannel(); |         channel_nr = cDevice::CurrentChannel(); | ||||||
|     } |     } | ||||||
|     LOCK_CHANNELS_READ; |     LOCK_CHANNELS_READ; | ||||||
|     if (channel_nr && (channel = Channels MURKS GetByNumber(channel_nr)) |     if (channel_nr && (channel = Channels->GetByNumber(channel_nr)) | ||||||
|         && (device = cDevice::GetDevice(channel, 0, false, false))) { |         && (device = cDevice::GetDevice(channel, 0, false, false))) { | ||||||
|  |  | ||||||
|         DelPip(); |         DelPip(); | ||||||
| @@ -2015,10 +1996,10 @@ static void PipNextAvailableChannel(int direction) | |||||||
|         bool ndr; |         bool ndr; | ||||||
|         cDevice *device; |         cDevice *device; | ||||||
|  |  | ||||||
|         channel = direction > 0 ? Channels MURKS Next(channel) |         channel = direction > 0 ? Channels->Next(channel) | ||||||
|             : Channels MURKS Prev(channel); |             : Channels->Prev(channel); | ||||||
|         if (!channel && Setup.ChannelsWrap) { |         if (!channel && Setup.ChannelsWrap) { | ||||||
|             channel = direction > 0 ? Channels MURKS First() : Channels MURKS Last(); |             channel = direction > 0 ? Channels->First() : Channels->Last(); | ||||||
|         } |         } | ||||||
|         if (channel && !channel->GroupSep() |         if (channel && !channel->GroupSep() | ||||||
|             && (device = cDevice::GetDevice(channel, 0, false, true)) |             && (device = cDevice::GetDevice(channel, 0, false, true)) | ||||||
| @@ -2049,7 +2030,7 @@ static void SwapPipChannels(void) | |||||||
|     if (channel) { |     if (channel) { | ||||||
|         LOCK_CHANNELS_READ; |         LOCK_CHANNELS_READ; | ||||||
|  |  | ||||||
|         Channels MURKS SwitchTo(channel->Number()); |         Channels->SwitchTo(channel->Number()); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2454,11 +2435,7 @@ class cSoftHdDevice:public cDevice | |||||||
|     virtual bool HasDecoder(void) const; |     virtual bool HasDecoder(void) const; | ||||||
|     virtual bool CanReplay(void) const; |     virtual bool CanReplay(void) const; | ||||||
|     virtual bool SetPlayMode(ePlayMode); |     virtual bool SetPlayMode(ePlayMode); | ||||||
| #if APIVERSNUM >= 20103 |  | ||||||
|     virtual void TrickSpeed(int, bool); |     virtual void TrickSpeed(int, bool); | ||||||
| #else |  | ||||||
|     virtual void TrickSpeed(int); |  | ||||||
| #endif |  | ||||||
|     virtual void Clear(void); |     virtual void Clear(void); | ||||||
|     virtual void Play(void); |     virtual void Play(void); | ||||||
|     virtual void Freeze(void); |     virtual void Freeze(void); | ||||||
| @@ -2467,10 +2444,8 @@ class cSoftHdDevice:public cDevice | |||||||
|     virtual bool Poll(cPoller &, int = 0); |     virtual bool Poll(cPoller &, int = 0); | ||||||
|     virtual bool Flush(int = 0); |     virtual bool Flush(int = 0); | ||||||
|     virtual int64_t GetSTC(void); |     virtual int64_t GetSTC(void); | ||||||
| #if APIVERSNUM >= 10733 |  | ||||||
|     virtual cRect CanScaleVideo(const cRect &, int = taCenter); |     virtual cRect CanScaleVideo(const cRect &, int = taCenter); | ||||||
|     virtual void ScaleVideo(const cRect & = cRect::Null); |     virtual void ScaleVideo(const cRect & = cRect::Null); | ||||||
| #endif |  | ||||||
|     virtual void SetVideoDisplayFormat(eVideoDisplayFormat); |     virtual void SetVideoDisplayFormat(eVideoDisplayFormat); | ||||||
|     virtual void SetVideoFormat(bool); |     virtual void SetVideoFormat(bool); | ||||||
|     virtual void GetVideoSize(int &, int &, double &); |     virtual void GetVideoSize(int &, int &, double &); | ||||||
| @@ -2656,21 +2631,12 @@ int64_t cSoftHdDevice::GetSTC(void) | |||||||
| **  @param speed    trick speed | **  @param speed    trick speed | ||||||
| **  @param forward  flag forward direction | **  @param forward  flag forward direction | ||||||
| */ | */ | ||||||
| #if APIVERSNUM >= 20103 |  | ||||||
| void cSoftHdDevice::TrickSpeed(int speed, bool forward) | void cSoftHdDevice::TrickSpeed(int speed, bool forward) | ||||||
| { | { | ||||||
|     dsyslog("[softhddev]%s: %d %d\n", __FUNCTION__, speed, forward); |     dsyslog("[softhddev]%s: %d %d\n", __FUNCTION__, speed, forward); | ||||||
|  |  | ||||||
|     ::TrickSpeed(speed); |     ::TrickSpeed(speed); | ||||||
| } | } | ||||||
| #else |  | ||||||
| void cSoftHdDevice::TrickSpeed(int speed) |  | ||||||
| { |  | ||||||
|     dsyslog("[softhddev]%s: %d\n", __FUNCTION__, speed); |  | ||||||
|  |  | ||||||
|     ::TrickSpeed(speed); |  | ||||||
| } |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
| **  Clears all video and audio data from the device. | **  Clears all video and audio data from the device. | ||||||
| @@ -2947,8 +2913,6 @@ uchar *cSoftHdDevice::GrabImage(int &size, bool jpeg, int quality, int width, in | |||||||
|     return::GrabImage(&size, jpeg, quality, width, height); |     return::GrabImage(&size, jpeg, quality, width, height); | ||||||
| } | } | ||||||
|  |  | ||||||
| #if APIVERSNUM >= 10733 |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
| **  Ask the output, if it can scale video. | **  Ask the output, if it can scale video. | ||||||
| ** | ** | ||||||
| @@ -2975,8 +2939,6 @@ void cSoftHdDevice::ScaleVideo(const cRect & rect) | |||||||
|     ::ScaleVideo(rect.X(), rect.Y(), rect.Width(), rect.Height()); |     ::ScaleVideo(rect.X(), rect.Y(), rect.Width(), rect.Height()); | ||||||
| } | } | ||||||
|  |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
| **  Call rgb to jpeg for C Plugin. | **  Call rgb to jpeg for C Plugin. | ||||||
| */ | */ | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								video.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								video.c
									
									
									
									
									
								
							| @@ -672,7 +672,6 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width, in | |||||||
|         (video_height * display_aspect_ratio.num + display_aspect_ratio.den - 1) / display_aspect_ratio.den; |         (video_height * display_aspect_ratio.num + display_aspect_ratio.den - 1) / display_aspect_ratio.den; | ||||||
|     *output_height = |     *output_height = | ||||||
|         (video_width * display_aspect_ratio.den + display_aspect_ratio.num - 1) / display_aspect_ratio.num; |         (video_width * display_aspect_ratio.den + display_aspect_ratio.num - 1) / display_aspect_ratio.num; | ||||||
| // JOJO |  | ||||||
|     if (*output_width > video_width) { |     if (*output_width > video_width) { | ||||||
|         *output_width = video_width; |         *output_width = video_width; | ||||||
|         *output_y += (video_height - *output_height) / 2; |         *output_y += (video_height - *output_height) / 2; | ||||||
| @@ -1420,9 +1419,9 @@ static int semid; | |||||||
| struct itimerval itimer; | struct itimerval itimer; | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| GLuint vao_buffer;                      // | GLuint vao_buffer; | ||||||
|  |  | ||||||
| //GLuint vao_vao[4];  // | //GLuint vao_vao[4]; | ||||||
| GLuint gl_shader = 0, gl_prog = 0, gl_fbo = 0;  // shader programm | GLuint gl_shader = 0, gl_prog = 0, gl_fbo = 0;  // shader programm | ||||||
| GLint gl_colormatrix, gl_colormatrix_c; | GLint gl_colormatrix, gl_colormatrix_c; | ||||||
| GLuint OSDfb = 0; | GLuint OSDfb = 0; | ||||||
| @@ -1936,8 +1935,8 @@ static CuvidDecoder *CuvidNewHwDecoder(VideoStream * stream) | |||||||
|     } |     } | ||||||
| #endif | #endif | ||||||
| #ifdef VAAPI | #ifdef VAAPI | ||||||
|     if ((i = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, "/dev/dri/renderD128", NULL, 0)) != 0) { |  | ||||||
|     // if ((i = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, ":0.0" , NULL, 0)) != 0 ) { |     // if ((i = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, ":0.0" , NULL, 0)) != 0 ) { | ||||||
|  |     if ((i = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, "/dev/dri/renderD128", NULL, 0)) != 0) { | ||||||
|         Fatal("codec: can't allocate HW video codec context err %04x", i); |         Fatal("codec: can't allocate HW video codec context err %04x", i); | ||||||
|     } |     } | ||||||
| #endif | #endif | ||||||
| @@ -2143,7 +2142,7 @@ void generateCUDAImage(CuvidDecoder * decoder, int index, const AVFrame * frame, | |||||||
| { | { | ||||||
|     int n; |     int n; | ||||||
|  |  | ||||||
|     for (n = 0; n < 2; n++) {           // |     for (n = 0; n < 2; n++) { | ||||||
|         // widthInBytes must account for the chroma plane |         // widthInBytes must account for the chroma plane | ||||||
|         // elements being two samples wide. |         // elements being two samples wide. | ||||||
|         CUDA_MEMCPY2D cpy = { |         CUDA_MEMCPY2D cpy = { | ||||||
| @@ -4154,8 +4153,6 @@ static void CuvidSyncDecoder(CuvidDecoder * decoder) | |||||||
|  |  | ||||||
|   skip_sync: |   skip_sync: | ||||||
|     // check if next field is available |     // check if next field is available | ||||||
| //JOJO    if (decoder->SurfaceField && filled <= 1 + 2 * decoder->Interlaced) { |  | ||||||
|  |  | ||||||
|     if (decoder->SurfaceField && filled <= 1 + 2 * decoder->Interlaced) { |     if (decoder->SurfaceField && filled <= 1 + 2 * decoder->Interlaced) { | ||||||
|         if (filled < 1 + 2 * decoder->Interlaced) { |         if (filled < 1 + 2 * decoder->Interlaced) { | ||||||
|             ++decoder->FramesDuped; |             ++decoder->FramesDuped; | ||||||
| @@ -4829,7 +4826,7 @@ static void VideoEvent(void) | |||||||
|  |  | ||||||
|         case MapNotify: |         case MapNotify: | ||||||
|             Debug(3, "video/event: MapNotify\n"); |             Debug(3, "video/event: MapNotify\n"); | ||||||
|             // <EFBFBD>wm workaround |             // wm workaround | ||||||
|             VideoThreadLock(); |             VideoThreadLock(); | ||||||
|             xcb_change_window_attributes(Connection, VideoWindow, XCB_CW_CURSOR, &VideoBlankCursor); |             xcb_change_window_attributes(Connection, VideoWindow, XCB_CW_CURSOR, &VideoBlankCursor); | ||||||
|             VideoThreadUnlock(); |             VideoThreadUnlock(); | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								video.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								video.h
									
									
									
									
									
								
							| @@ -113,7 +113,7 @@ extern void VideoSetContrast(int); | |||||||
| /// Set saturation adjustment. | /// Set saturation adjustment. | ||||||
| extern void VideoSetSaturation(int); | extern void VideoSetSaturation(int); | ||||||
|  |  | ||||||
|     /// Set Gamm. | /// Set Gamma. | ||||||
| extern void VideoSetGamma(int); | extern void VideoSetGamma(int); | ||||||
|  |  | ||||||
| /// Set ColorSpace. | /// Set ColorSpace. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user