Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
6ba9af8d
Commit
6ba9af8d
authored
Oct 27, 2015
by
Hugo Beauzée-Luyssen
Browse files
VLCThumbnailer: Try to cope with different libjpeg & evas fourccs
parent
b6da785f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/metadata_services/vlc/VLCThumbnailer.cpp
View file @
6ba9af8d
...
...
@@ -25,6 +25,13 @@
#include <cstring>
#ifdef WITH_JPEG
#include <jpeglib.h>
#if ( !defined(JPEG_LIB_VERSION_MAJOR) && !defined(JPEG_LIB_VERSION_MINOR) ) || \
( JPEG_LIB_VERSION_MAJOR <= 8 && JPEG_LIB_VERSION_MINOR < 4 )
//FIXME: I don't think we can expect this to work without VLC outputing BGR...
#define JPEG_COLORSPACE JCS_EXT_BGR
#else
#define JPEG_COLORSPACE JCS_RGB
#endif
#elif defined(WITH_EVAS)
#include <Evas_Engine_Buffer.h>
#endif
...
...
@@ -182,7 +189,7 @@ void VLCThumbnailer::setupVout( VLC::MediaPlayer& mp )
mp
.
setVideoFormatCallbacks
(
// Setup
[
this
,
&
mp
](
char
*
chroma
,
unsigned
int
*
width
,
unsigned
int
*
height
,
unsigned
int
*
pitches
,
unsigned
int
*
lines
)
{
strcpy
(
chroma
,
"RV32"
);
strcpy
(
chroma
,
VLC_FOURCC
);
const
float
inputAR
=
(
float
)
*
width
/
*
height
;
...
...
@@ -316,12 +323,7 @@ bool VLCThumbnailer::compress( std::shared_ptr<Media> file, void *data )
compInfo
.
image_width
=
DesiredWidth
;
compInfo
.
image_height
=
DesiredHeight
;
compInfo
.
input_components
=
Bpp
;
#if ( !defined(JPEG_LIB_VERSION_MAJOR) && !defined(JPEG_LIB_VERSION_MINOR) ) || \
( JPEG_LIB_VERSION_MAJOR <= 8 && JPEG_LIB_VERSION_MINOR < 4 )
compInfo
.
in_color_space
=
JCS_EXT_BGR
;
#else
compInfo
.
in_color_space
=
JCS_RGB
;
#endif
compInfo
.
in_color_space
=
JPEG_COLORSPACE
;
jpeg_set_defaults
(
&
compInfo
);
jpeg_set_quality
(
&
compInfo
,
85
,
TRUE
);
...
...
src/metadata_services/vlc/VLCThumbnailer.h
View file @
6ba9af8d
...
...
@@ -32,6 +32,16 @@
#include "IMetadataService.h"
#ifdef WITH_JPEG
#define BPP 3
#define VLC_FOURCC "RV24"
#elif defined(WITH_EVAS)
#define BPP 4
#define VLC_FOURCC "RV32"
#else
#error No compression strategy
#endif
class
VLCThumbnailer
:
public
IMetadataService
{
public:
...
...
@@ -52,7 +62,7 @@ private:
// Force a base width, let height be computed depending on A/R
static
const
uint32_t
DesiredWidth
=
320
;
static
const
uint32_t
DesiredHeight
=
200
;
// Aim for a 16:10 thumbnail
static
const
uint8_t
Bpp
=
4
;
static
const
uint8_t
Bpp
=
BPP
;
private:
VLC
::
Instance
m_instance
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment