Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
623f6fcf
Commit
623f6fcf
authored
Feb 11, 2011
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.videolan.org:vlc/vlc-1.1
parents
e0a5dde7
5dc14c41
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
798 additions
and
34 deletions
+798
-34
NEWS
NEWS
+10
-0
configure.ac
configure.ac
+1
-1
modules/codec/schroedinger.c
modules/codec/schroedinger.c
+744
-0
modules/demux/mkv/Ebml_parser.cpp
modules/demux/mkv/Ebml_parser.cpp
+3
-3
modules/demux/mkv/demux.cpp
modules/demux/mkv/demux.cpp
+5
-5
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+2
-0
modules/demux/mkv/matroska_segment_parse.cpp
modules/demux/mkv/matroska_segment_parse.cpp
+21
-21
modules/demux/mkv/mkv.hpp
modules/demux/mkv/mkv.hpp
+9
-1
po/fr.po
po/fr.po
+3
-3
No files found.
NEWS
View file @
623f6fcf
Changes between 1.1.7 and 1.1.8-git:
Changes between 1.1.7 and 1.1.8-git:
--------------------------------
--------------------------------
Interfaces:
* Luarc and luatelnet fixes
Encoder:
* new libschroedinger-based Dirac codec encoder
Translations:
* Update for Finnish, Galician, Dutch, Chinese, German, Japanese, Lithuanian,
Slovak, French
Changes between 1.1.6 and 1.1.7:
Changes between 1.1.6 and 1.1.7:
--------------------------------
--------------------------------
...
...
configure.ac
View file @
623f6fcf
...
@@ -3060,7 +3060,7 @@ PKG_ENABLE_MODULES_VLC([DIRAC], [], [dirac >= 0.10.0], [dirac encoder], [auto])
...
@@ -3060,7 +3060,7 @@ PKG_ENABLE_MODULES_VLC([DIRAC], [], [dirac >= 0.10.0], [dirac encoder], [auto])
dnl
dnl
dnl schroedinger decoder plugin (for dirac format video)
dnl schroedinger decoder plugin (for dirac format video)
dnl
dnl
PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.
6], [dirac de
coder using schroedinger], [auto])
PKG_ENABLE_MODULES_VLC([SCHROEDINGER], [], [schroedinger-1.0 >= 1.0.
10], [dirac decoder and en
coder using schroedinger], [auto])
dnl
dnl
dnl PNG decoder module
dnl PNG decoder module
...
...
modules/codec/schroedinger.c
View file @
623f6fcf
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
*
*
* Authors: Jonathan Rosser <jonathan.rosser@gmail.com>
* Authors: Jonathan Rosser <jonathan.rosser@gmail.com>
* David Flynn <davidf at rd dot bbc.co.uk>
* David Flynn <davidf at rd dot bbc.co.uk>
* Anuradha Suraparaju <asuraparaju at gmail dot com>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
...
@@ -31,6 +32,8 @@
...
@@ -31,6 +32,8 @@
# include "config.h"
# include "config.h"
#endif
#endif
#include <assert.h>
#include <vlc_common.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_codec.h>
...
@@ -43,6 +46,27 @@
...
@@ -43,6 +46,27 @@
*****************************************************************************/
*****************************************************************************/
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
OpenDecoder
(
vlc_object_t
*
);
static
void
CloseDecoder
(
vlc_object_t
*
);
static
void
CloseDecoder
(
vlc_object_t
*
);
static
int
OpenEncoder
(
vlc_object_t
*
);
static
void
CloseEncoder
(
vlc_object_t
*
);
#define ENC_CFG_PREFIX "sout-schro-"
#define ENC_CHROMAFMT "chroma_fmt"
#define ENC_CHROMAFMT_TEXT N_("Chroma format")
#define ENC_CHROMAFMT_LONGTEXT N_("Picking chroma format will force a " \
"conversion of the video into that format")
static
const
char
*
const
enc_chromafmt_list
[]
=
{
"420"
,
"422"
,
"444"
};
static
const
char
*
const
enc_chromafmt_list_text
[]
=
{
N_
(
"4:2:0"
),
N_
(
"4:2:2"
),
N_
(
"4:4:4"
)
};
#define ENC_CODINGMODE "auto_coding_mode"
#define ENC_CODINGMODE_TEXT N_("Automate picture coding mode")
#define ENC_CODINGMODE_LONGTEXT N_("Use the input picture to determine how to" \
" code it - interlaced or progressive")
static
const
char
**
ppsz_enc_options
=
NULL
;
vlc_module_begin
()
vlc_module_begin
()
set_category
(
CAT_INPUT
)
set_category
(
CAT_INPUT
)
...
@@ -51,6 +75,66 @@ vlc_module_begin ()
...
@@ -51,6 +75,66 @@ vlc_module_begin ()
set_capability
(
"decoder"
,
200
)
set_capability
(
"decoder"
,
200
)
set_callbacks
(
OpenDecoder
,
CloseDecoder
)
set_callbacks
(
OpenDecoder
,
CloseDecoder
)
add_shortcut
(
"schroedinger"
)
add_shortcut
(
"schroedinger"
)
add_submodule
()
set_description
(
N_
(
"Dirac video encoder using libschroedinger"
)
)
set_capability
(
"encoder"
,
105
)
set_callbacks
(
OpenEncoder
,
CloseEncoder
)
add_shortcut
(
"schroedinger"
)
int
i_numopts
=
schro_encoder_get_n_settings
();
/* Allocate for schro encoder options + chroma format + coding mode
+ null */
ppsz_enc_options
=
(
const
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
i_numopts
+
3
)
);
if
(
unlikely
(
ppsz_enc_options
==
NULL
)
)
return
VLC_ENOMEM
;
for
(
int
i
=
0
;
i
<
i_numopts
;
++
i
)
{
const
SchroEncoderSetting
*
p_setting
=
schro_encoder_get_setting_info
(
i
);
bool
b_advanced
=
(
strlen
(
p_setting
->
name
)
>
6
&&
!
strncmp
(
p_setting
->
name
,
"magic_ "
,
6
)
);
char
*
p_cfg_setting_name
=
malloc
(
strlen
(
ENC_CFG_PREFIX
)
+
strlen
(
p_setting
->
name
)
+
1
);
if
(
unlikely
(
p_cfg_setting_name
==
NULL
)
)
return
VLC_ENOMEM
;
strcpy
(
p_cfg_setting_name
,
ENC_CFG_PREFIX
);
strcat
(
p_cfg_setting_name
,
p_setting
->
name
);
ppsz_enc_options
[
i
]
=
strdup
(
p_setting
->
name
);
switch
(
p_setting
->
type
)
{
case
SCHRO_ENCODER_SETTING_TYPE_BOOLEAN
:
add_bool
(
p_cfg_setting_name
,
p_setting
->
default_value
,
NULL
,
p_setting
->
name
,
p_setting
->
name
,
b_advanced
);
break
;
case
SCHRO_ENCODER_SETTING_TYPE_INT
:
add_integer
(
p_cfg_setting_name
,
p_setting
->
default_value
,
NULL
,
p_setting
->
name
,
p_setting
->
name
,
b_advanced
);
change_integer_range
(
p_setting
->
min
,
p_setting
->
max
);
break
;
case
SCHRO_ENCODER_SETTING_TYPE_DOUBLE
:
add_float
(
p_cfg_setting_name
,
p_setting
->
default_value
,
NULL
,
p_setting
->
name
,
p_setting
->
name
,
b_advanced
);
change_float_range
(
p_setting
->
min
,
p_setting
->
max
);
break
;
case
SCHRO_ENCODER_SETTING_TYPE_ENUM
:
add_string
(
p_cfg_setting_name
,
p_setting
->
enum_list
[(
int
)
p_setting
->
default_value
],
NULL
,
p_setting
->
name
,
p_setting
->
name
,
b_advanced
);
vlc_config_set
(
p_config
,
VLC_CONFIG_LIST
,
(
int
)(
p_setting
->
max
-
p_setting
->
min
+
1
),
p_setting
->
enum_list
,
p_setting
->
enum_list
,
0
);
break
;
default:
break
;
}
free
(
p_cfg_setting_name
);
}
ppsz_enc_options
[
i_numopts
]
=
strdup
(
ENC_CHROMAFMT
);
add_string
(
ENC_CFG_PREFIX
ENC_CHROMAFMT
,
"420"
,
NULL
,
ENC_CHROMAFMT_TEXT
,
ENC_CHROMAFMT_LONGTEXT
,
false
)
change_string_list
(
enc_chromafmt_list
,
enc_chromafmt_list_text
,
0
);
ppsz_enc_options
[
i_numopts
+
1
]
=
strdup
(
ENC_CODINGMODE
);
add_bool
(
ENC_CFG_PREFIX
ENC_CODINGMODE
,
true
,
NULL
,
ENC_CODINGMODE_TEXT
,
ENC_CODINGMODE_LONGTEXT
,
false
)
ppsz_enc_options
[
i_numopts
+
2
]
=
NULL
;
vlc_module_end
()
vlc_module_end
()
/*****************************************************************************
/*****************************************************************************
...
@@ -393,3 +477,663 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -393,3 +477,663 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
}
}
}
}
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
block_t
*
Encode
(
encoder_t
*
p_enc
,
picture_t
*
p_pict
);
/*****************************************************************************
* picture_pts_t : store pts alongside picture number, not carried through
* encoder
*****************************************************************************/
struct
picture_pts_t
{
bool
b_empty
;
/* entry is invalid */
uint32_t
u_pnum
;
/* dirac picture number */
mtime_t
i_pts
;
/* associated pts */
};
/*****************************************************************************
* encoder_sys_t : Schroedinger encoder descriptor
*****************************************************************************/
#define SCHRO_PTS_TLB_SIZE 256
struct
encoder_sys_t
{
/*
* Schro properties
*/
SchroEncoder
*
p_schro
;
SchroVideoFormat
*
p_format
;
int
started
;
bool
b_auto_field_coding
;
uint32_t
i_input_picnum
;
block_fifo_t
*
p_dts_fifo
;
block_t
*
p_chain
;
struct
picture_pts_t
pts_tlb
[
SCHRO_PTS_TLB_SIZE
];
mtime_t
i_pts_offset
;
mtime_t
i_field_time
;
bool
b_eos_signalled
;
bool
b_eos_pulled
;
};
static
struct
{
unsigned
int
i_height
;
int
i_approx_fps
;
SchroVideoFormatEnum
i_vf
;
}
schro_format_guess
[]
=
{
/* Important: Keep this list ordered in ascending picture height */
{
1
,
0
,
SCHRO_VIDEO_FORMAT_CUSTOM
},
{
120
,
15
,
SCHRO_VIDEO_FORMAT_QSIF
},
{
144
,
12
,
SCHRO_VIDEO_FORMAT_QCIF
},
{
240
,
15
,
SCHRO_VIDEO_FORMAT_SIF
},
{
288
,
12
,
SCHRO_VIDEO_FORMAT_CIF
},
{
480
,
30
,
SCHRO_VIDEO_FORMAT_SD480I_60
},
{
480
,
15
,
SCHRO_VIDEO_FORMAT_4SIF
},
{
576
,
12
,
SCHRO_VIDEO_FORMAT_4CIF
},
{
576
,
25
,
SCHRO_VIDEO_FORMAT_SD576I_50
},
{
720
,
50
,
SCHRO_VIDEO_FORMAT_HD720P_50
},
{
720
,
60
,
SCHRO_VIDEO_FORMAT_HD720P_60
},
{
1080
,
24
,
SCHRO_VIDEO_FORMAT_DC2K_24
},
{
1080
,
25
,
SCHRO_VIDEO_FORMAT_HD1080I_50
},
{
1080
,
30
,
SCHRO_VIDEO_FORMAT_HD1080I_60
},
{
1080
,
50
,
SCHRO_VIDEO_FORMAT_HD1080P_50
},
{
1080
,
60
,
SCHRO_VIDEO_FORMAT_HD1080P_60
},
{
2160
,
24
,
SCHRO_VIDEO_FORMAT_DC4K_24
},
{
0
,
0
,
0
},
};
/*****************************************************************************
* ResetPTStlb: Purge all entries in @p_enc@'s PTS-tlb
*****************************************************************************/
static
void
ResetPTStlb
(
encoder_t
*
p_enc
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
for
(
int
i
=
0
;
i
<
SCHRO_PTS_TLB_SIZE
;
i
++
)
{
p_sys
->
pts_tlb
[
i
].
b_empty
=
true
;
}
}
/*****************************************************************************
* StorePicturePTS: Store the PTS value for a particular picture number
*****************************************************************************/
static
void
StorePicturePTS
(
encoder_t
*
p_enc
,
uint32_t
u_pnum
,
mtime_t
i_pts
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
for
(
int
i
=
0
;
i
<
SCHRO_PTS_TLB_SIZE
;
i
++
)
{
if
(
p_sys
->
pts_tlb
[
i
].
b_empty
)
{
p_sys
->
pts_tlb
[
i
].
u_pnum
=
u_pnum
;
p_sys
->
pts_tlb
[
i
].
i_pts
=
i_pts
;
p_sys
->
pts_tlb
[
i
].
b_empty
=
false
;
return
;
}
}
msg_Err
(
p_enc
,
"Could not store PTS %"
PRId64
" for frame %u"
,
i_pts
,
u_pnum
);
}
/*****************************************************************************
* GetPicturePTS: Retrieve the PTS value for a particular picture number
*****************************************************************************/
static
mtime_t
GetPicturePTS
(
encoder_t
*
p_enc
,
uint32_t
u_pnum
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
for
(
int
i
=
0
;
i
<
SCHRO_PTS_TLB_SIZE
;
i
++
)
{
if
(
!
p_sys
->
pts_tlb
[
i
].
b_empty
&&
p_sys
->
pts_tlb
[
i
].
u_pnum
==
u_pnum
)
{
p_sys
->
pts_tlb
[
i
].
b_empty
=
true
;
return
p_sys
->
pts_tlb
[
i
].
i_pts
;
}
}
msg_Err
(
p_enc
,
"Could not retrieve PTS for picture %u"
,
u_pnum
);
return
0
;
}
static
inline
bool
SchroSetEnum
(
const
encoder_t
*
p_enc
,
const
SchroEncoderSetting
*
p_setting
,
const
char
*
psz_value
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
if
(
psz_value
&&
p_setting
&&
p_setting
->
type
==
SCHRO_ENCODER_SETTING_TYPE_ENUM
)
{
int
i_index
=
-
1
;
int
i_list_size
=
p_setting
->
max
-
p_setting
->
min
+
1
;
for
(
int
i
=
0
;
i
<
i_list_size
;
++
i
)
{
if
(
strcmp
(
p_setting
->
enum_list
[
i
],
psz_value
)
)
continue
;
i_index
=
p_setting
->
min
+
i
;
schro_encoder_setting_set_double
(
p_sys
->
p_schro
,
p_setting
->
name
,
i_index
);
return
true
;
}
if
(
i_index
==
-
1
)
{
msg_Err
(
p_enc
,
"Invalid %s: %s"
,
p_setting
->
name
,
psz_value
);
}
}
return
false
;
}
static
bool
SetEncChromaFormat
(
encoder_t
*
p_enc
,
uint32_t
i_codec
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
switch
(
i_codec
)
{
case
VLC_CODEC_I420
:
p_enc
->
fmt_in
.
i_codec
=
i_codec
;
p_enc
->
fmt_in
.
video
.
i_bits_per_pixel
=
12
;
p_sys
->
p_format
->
chroma_format
=
SCHRO_CHROMA_420
;
break
;
case
VLC_CODEC_I422
:
p_enc
->
fmt_in
.
i_codec
=
i_codec
;
p_enc
->
fmt_in
.
video
.
i_bits_per_pixel
=
16
;
p_sys
->
p_format
->
chroma_format
=
SCHRO_CHROMA_422
;
break
;
case
VLC_CODEC_I444
:
p_enc
->
fmt_in
.
i_codec
=
i_codec
;
p_enc
->
fmt_in
.
video
.
i_bits_per_pixel
=
24
;
p_sys
->
p_format
->
chroma_format
=
SCHRO_CHROMA_444
;
break
;
default:
return
false
;
}
return
true
;
}
/*****************************************************************************
* OpenEncoder: probe the encoder and return score
*****************************************************************************/
static
int
OpenEncoder
(
vlc_object_t
*
p_this
)
{
encoder_t
*
p_enc
=
(
encoder_t
*
)
p_this
;
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
int
i_tmp
;
float
f_tmp
;
bool
b_tmp
;
char
*
psz_tmp
;
if
(
p_enc
->
fmt_out
.
i_codec
!=
VLC_CODEC_DIRAC
&&
!
p_enc
->
b_force
)
{
return
VLC_EGENERIC
;
}
if
(
!
p_enc
->
fmt_in
.
video
.
i_frame_rate
||
!
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
||
!
p_enc
->
fmt_in
.
video
.
i_height
||
!
p_enc
->
fmt_in
.
video
.
i_width
)
{
msg_Err
(
p_enc
,
"Framerate and picture dimensions must be non-zero"
);
return
VLC_EGENERIC
;
}
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
)
)
==
NULL
)
return
VLC_ENOMEM
;
p_enc
->
p_sys
=
p_sys
;
p_enc
->
pf_encode_video
=
Encode
;
p_enc
->
fmt_out
.
i_codec
=
VLC_CODEC_DIRAC
;
p_enc
->
fmt_out
.
i_cat
=
VIDEO_ES
;
if
(
(
p_sys
->
p_dts_fifo
=
block_FifoNew
()
)
==
NULL
)
{
CloseEncoder
(
p_this
);
return
VLC_ENOMEM
;
}
ResetPTStlb
(
p_enc
);
/* guess the video format based upon number of lines and picture height */
int
i
=
0
;
SchroVideoFormatEnum
guessed_video_fmt
=
SCHRO_VIDEO_FORMAT_CUSTOM
;
/* Pick the dirac_video_format in this order of preference:
* 1. an exact match in frame height and an approximate fps match
* 2. the previous preset with a smaller number of lines.
*/
do
{
if
(
schro_format_guess
[
i
].
i_height
>
p_enc
->
fmt_in
.
video
.
i_height
)
{
guessed_video_fmt
=
schro_format_guess
[
i
-
1
].
i_vf
;
break
;
}
if
(
schro_format_guess
[
i
].
i_height
!=
p_enc
->
fmt_in
.
video
.
i_height
)
continue
;
int
src_fps
=
p_enc
->
fmt_in
.
video
.
i_frame_rate
/
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
;
int
delta_fps
=
abs
(
schro_format_guess
[
i
].
i_approx_fps
-
src_fps
);
if
(
delta_fps
>
2
)
continue
;
guessed_video_fmt
=
schro_format_guess
[
i
].
i_vf
;
break
;
}
while
(
schro_format_guess
[
++
i
].
i_height
);
schro_init
();
p_sys
->
p_schro
=
schro_encoder_new
();
if
(
!
p_sys
->
p_schro
)
{
msg_Err
(
p_enc
,
"Failed to initialize libschroedinger encoder"
);
return
VLC_EGENERIC
;
}
schro_encoder_set_packet_assembly
(
p_sys
->
p_schro
,
true
);
if
(
!
(
p_sys
->
p_format
=
schro_encoder_get_video_format
(
p_sys
->
p_schro
)
)
)
{
msg_Err
(
p_enc
,
"Failed to get Schroedigner video format"
);
schro_encoder_free
(
p_sys
->
p_schro
);
return
VLC_EGENERIC
;
}
/* initialise the video format parameters to the guessed format */
schro_video_format_set_std_video_format
(
p_sys
->
p_format
,
guessed_video_fmt
);
/* constants set from the input video format */
p_sys
->
p_format
->
width
=
p_enc
->
fmt_in
.
video
.
i_width
;
p_sys
->
p_format
->
height
=
p_enc
->
fmt_in
.
video
.
i_height
;
p_sys
->
p_format
->
frame_rate_numerator
=
p_enc
->
fmt_in
.
video
.
i_frame_rate
;
p_sys
->
p_format
->
frame_rate_denominator
=
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
;
unsigned
u_asr_num
,
u_asr_den
;
vlc_ureduce
(
&
u_asr_num
,
&
u_asr_den
,
p_enc
->
fmt_in
.
video
.
i_sar_num
,
p_enc
->
fmt_in
.
video
.
i_sar_den
,
0
);
p_sys
->
p_format
->
aspect_ratio_numerator
=
u_asr_num
;
p_sys
->
p_format
->
aspect_ratio_denominator
=
u_asr_den
;
config_ChainParse
(
p_enc
,
ENC_CFG_PREFIX
,
ppsz_enc_options
,
p_enc
->
p_cfg
);
int
i_numopts
=
schro_encoder_get_n_settings
();
for
(
int
i
=
0
;
i
<
i_numopts
;
++
i
)
{
const
SchroEncoderSetting
*
p_setting
=
schro_encoder_get_setting_info
(
i
);
char
*
p_cfg_setting_name
=
malloc
(
strlen
(
ENC_CFG_PREFIX
)
+
strlen
(
p_setting
->
name
)
+
1
);
if
(
unlikely
(
p_cfg_setting_name
==
NULL
)
)
return
VLC_ENOMEM
;
strcpy
(
p_cfg_setting_name
,
ENC_CFG_PREFIX
);
strcat
(
p_cfg_setting_name
,
p_setting
->
name
);
switch
(
p_setting
->
type
)
{
case
SCHRO_ENCODER_SETTING_TYPE_BOOLEAN
:
schro_encoder_setting_set_double
(
p_sys
->
p_schro
,
p_setting
->
name
,
var_GetBool
(
p_enc
,
p_cfg_setting_name
)
);
break
;
case
SCHRO_ENCODER_SETTING_TYPE_INT
:
i_tmp
=
var_GetInteger
(
p_enc
,
p_cfg_setting_name
);
schro_encoder_setting_set_double
(
p_sys
->
p_schro
,
p_setting
->
name
,
i_tmp
);
/* A kludge to set bitrate to the value in sout-transcode-vb */
if
(
!
strcmp
(
p_setting
->
name
,
"bitrate"
)
)
{
if
(
i_tmp
==
p_setting
->
default_value
)
schro_encoder_setting_set_double
(
p_sys
->
p_schro
,
p_setting
->
name
,
p_enc
->
fmt_out
.
i_bitrate
);
p_enc
->
fmt_out
.
i_bitrate
=
schro_encoder_setting_get_double
(
p_sys
->
p_schro
,
p_setting
->
name
);
}
break
;
case
SCHRO_ENCODER_SETTING_TYPE_DOUBLE
:
f_tmp
=
var_GetFloat
(
p_enc
,
p_cfg_setting_name
);
if
(
f_tmp
>=
0
.
0
)
schro_encoder_setting_set_double
(
p_sys
->
p_schro
,
p_setting
->
name
,
f_tmp
);
break
;
case
SCHRO_ENCODER_SETTING_TYPE_ENUM
:
psz_tmp
=
var_GetString
(
p_enc
,
p_cfg_setting_name
);
if
(
!
psz_tmp
)
goto
error
;
else
if
(
*
psz_tmp
!=
'\0'
)
{
if
(
!
SchroSetEnum
(
p_enc
,
p_setting
,
psz_tmp
)
)
{
free
(
psz_tmp
);
goto
error
;
}
}
free
(
psz_tmp
);
break
;
default:
break
;
}
free
(
p_cfg_setting_name
);
}
psz_tmp
=
var_GetString
(
p_enc
,
ENC_CFG_PREFIX
ENC_CHROMAFMT
);
if
(
!
psz_tmp
)
goto
error
;
else
{
uint32_t
i_codec
;
if
(
!
strcmp
(
psz_tmp
,
"420"
)
)
{
i_codec
=
VLC_CODEC_I420
;
}
else
if
(
!
strcmp
(
psz_tmp
,
"422"
)
)
{
i_codec
=
VLC_CODEC_I422
;
}
else
if
(
!
strcmp
(
psz_tmp
,
"444"
)
)
{
i_codec
=
VLC_CODEC_I444
;
}
else
{
msg_Err
(
p_enc
,
"Invalid chroma format: %s"
,
psz_tmp
);
free
(
psz_tmp
);
goto
error
;
}
SetEncChromaFormat
(
p_enc
,
i_codec
);
}
free
(
psz_tmp
);
b_tmp
=
var_GetBool
(
p_enc
,
ENC_CFG_PREFIX
ENC_CODINGMODE
);
if
(
b_tmp
==
true
)
p_sys
->
b_auto_field_coding
=
true
;
else
p_sys
->
b_auto_field_coding
=
false
;
p_sys
->
started
=
0
;
return
VLC_SUCCESS
;
error:
CloseEncoder
(
p_this
);
return
VLC_EGENERIC
;
}
struct
enc_picture_free_t
{
picture_t
*
p_pic
;
encoder_t
*
p_enc
;
};
/*****************************************************************************
* EncSchroFrameFree: schro_frame callback to release the associated picture_t
* When schro_encoder_reset() is called there will be pictures in the
* encoding pipeline that need to be released rather than displayed.
*****************************************************************************/
static
void
EncSchroFrameFree
(
SchroFrame
*
frame
,
void
*
priv
)
{
struct
enc_picture_free_t
*
p_free
=
priv
;
if
(
!
p_free
)
return
;
picture_Release
(
p_free
->
p_pic
);
free
(
p_free
);
(
void
)
frame
;
}
/*****************************************************************************
* CreateSchroFrameFromPic: wrap a picture_t in a SchroFrame
*****************************************************************************/
static
SchroFrame
*
CreateSchroFrameFromInputPic
(
encoder_t
*
p_enc
,
picture_t
*
p_pic
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
SchroFrame
*
p_schroframe
=
schro_frame_new
();
struct
enc_picture_free_t
*
p_free
;
if
(
!
p_schroframe
)
return
NULL
;
if
(
!
p_pic
)
return
NULL
;
p_schroframe
->
format
=
SCHRO_FRAME_FORMAT_U8_420
;
if
(
p_sys
->
p_format
->
chroma_format
==
SCHRO_CHROMA_422
)
{
p_schroframe
->
format
=
SCHRO_FRAME_FORMAT_U8_422
;
}
else
if
(
p_sys
->
p_format
->
chroma_format
==
SCHRO_CHROMA_444
)
{
p_schroframe
->
format
=
SCHRO_FRAME_FORMAT_U8_444
;
}
p_schroframe
->
width
=
p_sys
->
p_format
->
width
;
p_schroframe
->
height
=
p_sys
->
p_format
->
height
;
p_free
=
malloc
(
sizeof
(
*
p_free
)
);
if
(
unlikely
(
p_free
==
NULL
)
)
{
schro_frame_unref
(
p_schroframe
);
return
NULL
;
}
p_free
->
p_pic
=
p_pic
;
p_free
->
p_enc
=
p_enc
;
schro_frame_set_free_callback
(
p_schroframe
,
EncSchroFrameFree
,
p_free
);
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
p_schroframe
->
components
[
i
].
width
=
p_pic
->
p
[
i
].
i_visible_pitch
;
p_schroframe
->
components
[
i
].
stride
=
p_pic
->
p
[
i
].
i_pitch
;
p_schroframe
->
components
[
i
].
height
=
p_pic
->
p
[
i
].
i_visible_lines
;
p_schroframe
->
components
[
i
].
length
=
p_pic
->
p
[
i
].
i_pitch
*
p_pic
->
p
[
i
].
i_lines
;
p_schroframe
->
components
[
i
].
data
=
p_pic
->
p
[
i
].
p_pixels
;
if
(
i
!=
0
)
{
p_schroframe
->
components
[
i
].
v_shift
=
SCHRO_FRAME_FORMAT_V_SHIFT
(
p_schroframe
->
format
);
p_schroframe
->
components
[
i
].
h_shift
=
SCHRO_FRAME_FORMAT_H_SHIFT
(
p_schroframe
->
format
);
}
}
return
p_schroframe
;
}
/* Attempt to find dirac picture number in an encapsulation unit */
static
int
ReadDiracPictureNumber
(
uint32_t
*
p_picnum
,
block_t
*
p_block
)
{
uint32_t
u_pos
=
4
;
/* protect against falling off the edge */
while
(
u_pos
+
13
<
p_block
->
i_buffer
)
{
/* find the picture startcode */
if
(
p_block
->
p_buffer
[
u_pos
]
&
0x08
)
{
*
p_picnum
=
GetDWBE
(
p_block
->
p_buffer
+
u_pos
+
9
);
return
1
;
}
/* skip to the next dirac data unit */
uint32_t
u_npo
=
GetDWBE
(
p_block
->
p_buffer
+
u_pos
+
1
);
assert
(
u_npo
<=
UINT32_MAX
-
u_pos
);
if
(
u_npo
==
0
)
u_npo
=
13
;
u_pos
+=
u_npo
;
}
return
0
;
}
static
block_t
*
Encode
(
encoder_t
*
p_enc
,
picture_t
*
p_pic
)
{
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
block_t
*
p_block
,
*
p_output_chain
=
NULL
;
SchroFrame
*
p_frame
;
bool
b_go
=
true
;
if
(
!
p_pic
)
{
if
(
!
p_sys
->
started
||
p_sys
->
b_eos_pulled
)
return
NULL
;
if
(
!
p_sys
->
b_eos_signalled
)
{
p_sys
->
b_eos_signalled
=
1
;
schro_encoder_end_of_stream
(
p_sys
->
p_schro
);
}
}
else
{
/* we only know if the sequence is interlaced when the first
* picture arrives, so final setup is done here */
/* XXX todo, detect change of interlace */
p_sys
->
p_format
->
interlaced
=
!
p_pic
->
b_progressive
;
p_sys
->
p_format
->
top_field_first
=
p_pic
->
b_top_field_first
;
if
(
p_sys
->
b_auto_field_coding
)
schro_encoder_setting_set_double
(
p_sys
->
p_schro
,
"interlaced_coding"
,
!
p_pic
->
b_progressive
);
}
if
(
!
p_sys
->
started
)
{
date_t
date
;
if
(
p_pic
->
format
.
i_chroma
!=
p_enc
->
fmt_in
.
i_codec
)
{
char
chroma_in
[
5
],
chroma_out
[
5
];
vlc_fourcc_to_char
(
p_pic
->
format
.
i_chroma
,
chroma_in
);
chroma_in
[
4
]
=
'\0'
;
chroma_out
[
4
]
=
'\0'
;
vlc_fourcc_to_char
(
p_enc
->
fmt_in
.
i_codec
,
chroma_out
);
msg_Warn
(
p_enc
,
"Resetting chroma from %s to %s"
,
chroma_out
,
chroma_in
);
if
(
!
SetEncChromaFormat
(
p_enc
,
p_pic
->
format
.
i_chroma
)
)
{
msg_Err
(
p_enc
,
"Could not reset chroma format to %s"
,
chroma_in
);
return
NULL
;
}
}
date_Init
(
&
date
,
p_enc
->
fmt_in
.
video
.
i_frame_rate
,
p_enc
->
fmt_in
.
video
.
i_frame_rate_base
);
/* FIXME - Unlike dirac-research codec Schro doesn't have a function that returns the delay in pics yet.
* Use a default of 1
*/
date_Increment
(
&
date
,
1
);
p_sys
->
i_pts_offset
=
date_Get
(
&
date
);
if
(
schro_encoder_setting_get_double
(
p_sys
->
p_schro
,
"interlaced_coding"
)
>
0
.
0
)
{
date_Set
(
&
date
,
0
);
date_Increment
(
&
date
,
1
);
p_sys
->
i_field_time
=
date_Get
(
&
date
)
/
2
;
}
schro_video_format_set_std_signal_range
(
p_sys
->
p_format
,
SCHRO_SIGNAL_RANGE_8BIT_VIDEO
);
schro_encoder_set_video_format
(
p_sys
->
p_schro
,
p_sys
->
p_format
);
schro_encoder_start
(
p_sys
->
p_schro
);
p_sys
->
started
=
1
;
}
if
(
!
p_sys
->
b_eos_signalled
)
{
/* create a schro frame from the input pic and load */
/* Increase ref count by 1 so that the picture is not freed until
Schro finishes with it */
picture_Hold
(
p_pic
);
p_frame
=
CreateSchroFrameFromInputPic
(
p_enc
,
p_pic
);
if
(
!
p_frame
)
return
NULL
;
schro_encoder_push_frame
(
p_sys
->
p_schro
,
p_frame
);
/* store pts in a lookaside buffer, so that the same pts may
* be used for the picture in coded order */
StorePicturePTS
(
p_enc
,
p_sys
->
i_input_picnum
,
p_pic
->
date
);
p_sys
->
i_input_picnum
++
;
/* store dts in a queue, so that they appear in order in
* coded order */
p_block
=
block_New
(
p_enc
,
1
);
if
(
!
p_block
)
return
NULL
;
p_block
->
i_dts
=
p_pic
->
date
-
p_sys
->
i_pts_offset
;
block_FifoPut
(
p_sys
->
p_dts_fifo
,
p_block
);
p_block
=
NULL
;
/* for field coding mode, insert an extra value into both the
* pts lookaside buffer and dts queue, offset to correspond
* to a one field delay. */
if
(
schro_encoder_setting_get_double
(
p_sys
->
p_schro
,
"interlaced_coding"
)
>
0
.
0
)
{
StorePicturePTS
(
p_enc
,
p_sys
->
i_input_picnum
,
p_pic
->
date
+
p_sys
->
i_field_time
);
p_sys
->
i_input_picnum
++
;
p_block
=
block_New
(
p_enc
,
1
);
if
(
!
p_block
)
return
NULL
;
p_block
->
i_dts
=
p_pic
->
date
-
p_sys
->
i_pts_offset
+
p_sys
->
i_field_time
;
block_FifoPut
(
p_sys
->
p_dts_fifo
,
p_block
);
p_block
=
NULL
;
}
}
do
{
SchroStateEnum
state
;
state
=
schro_encoder_wait
(
p_sys
->
p_schro
);
switch
(
state
)
{
case
SCHRO_STATE_NEED_FRAME
:
b_go
=
false
;
break
;
case
SCHRO_STATE_AGAIN
:
break
;
case
SCHRO_STATE_END_OF_STREAM
:
p_sys
->
b_eos_pulled
=
1
;
b_go
=
false
;
break
;
case
SCHRO_STATE_HAVE_BUFFER
:
{
SchroBuffer
*
p_enc_buf
;
uint32_t
u_pic_num
;
int
i_presentation_frame
;
p_enc_buf
=
schro_encoder_pull
(
p_sys
->
p_schro
,
&
i_presentation_frame
);
p_block
=
block_New
(
p_enc
,
p_enc_buf
->
length
);
if
(
!
p_block
)
return
NULL
;
memcpy
(
p_block
->
p_buffer
,
p_enc_buf
->
data
,
p_enc_buf
->
length
);
schro_buffer_unref
(
p_enc_buf
);
/* Presence of a Sequence header indicates a seek point */
if
(
0
==
p_block
->
p_buffer
[
4
]
)
{
p_block
->
i_flags
|=
BLOCK_FLAG_TYPE_I
;
if
(
!
p_enc
->
fmt_out
.
p_extra
)
{
const
uint8_t
eos
[]
=
{
'B'
,
'B'
,
'C'
,
'D'
,
0x10
,
0
,
0
,
0
,
13
,
0
,
0
,
0
,
0
};
uint32_t
len
=
GetDWBE
(
p_block
->
p_buffer
+
5
);
/* if it hasn't been done so far, stash a copy of the
* sequence header for muxers such as ogg */
/* The OggDirac spec advises that a Dirac EOS DataUnit
* is appended to the sequence header to allow guard
* against poor streaming servers */
/* XXX, should this be done using the packetizer ? */
p_enc
->
fmt_out
.
p_extra
=
malloc
(
len
+
sizeof
(
eos
)
);
if
(
!
p_enc
->
fmt_out
.
p_extra
)
return
NULL
;
memcpy
(
p_enc
->
fmt_out
.
p_extra
,
p_block
->
p_buffer
,
len
);
memcpy
(
(
uint8_t
*
)
p_enc
->
fmt_out
.
p_extra
+
len
,
eos
,
sizeof
(
eos
)
);
SetDWBE
(
(
uint8_t
*
)
p_enc
->
fmt_out
.
p_extra
+
len
+
10
,
len
);
p_enc
->
fmt_out
.
i_extra
=
len
+
sizeof
(
eos
);
}
}
if
(
ReadDiracPictureNumber
(
&
u_pic_num
,
p_block
)
)
{
block_t
*
p_dts_block
=
block_FifoGet
(
p_sys
->
p_dts_fifo
);
p_block
->
i_dts
=
p_dts_block
->
i_dts
;
p_block
->
i_pts
=
GetPicturePTS
(
p_enc
,
u_pic_num
);
block_Release
(
p_dts_block
);
block_ChainAppend
(
&
p_output_chain
,
p_block
);
}
else
{
/* End of sequence */
block_ChainAppend
(
&
p_output_chain
,
p_block
);
}
break
;
}
default:
break
;
}
}
while
(
b_go
);
return
p_output_chain
;
}
/*****************************************************************************
* CloseEncoder: Schro encoder destruction
*****************************************************************************/
static
void
CloseEncoder
(
vlc_object_t
*
p_this
)
{
encoder_t
*
p_enc
=
(
encoder_t
*
)
p_this
;
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
/* Free the encoder resources */
if
(
p_sys
->
p_schro
)
schro_encoder_free
(
p_sys
->
p_schro
);
free
(
p_sys
->
p_format
);
if
(
p_sys
->
p_dts_fifo
)
block_FifoRelease
(
p_sys
->
p_dts_fifo
);
block_ChainRelease
(
p_sys
->
p_chain
);
free
(
p_sys
);
}
modules/demux/mkv/Ebml_parser.cpp
View file @
623f6fcf
...
@@ -144,7 +144,7 @@ class KaxBlockVirtualWorkaround : public KaxBlockVirtual
...
@@ -144,7 +144,7 @@ class KaxBlockVirtualWorkaround : public KaxBlockVirtual
public:
public:
void
Fix
()
void
Fix
()
{
{
if
(
Data
==
DataBlock
)
if
(
GetBuffer
()
==
DataBlock
)
SetBuffer
(
NULL
,
0
);
SetBuffer
(
NULL
,
0
);
}
}
};
};
...
@@ -167,7 +167,7 @@ EbmlElement *EbmlParser::Get( void )
...
@@ -167,7 +167,7 @@ EbmlElement *EbmlParser::Get( void )
if
(
m_el
[
mi_level
]
)
if
(
m_el
[
mi_level
]
)
{
{
m_el
[
mi_level
]
->
SkipData
(
*
m_es
,
m_el
[
mi_level
]
->
Generic
().
Context
);
m_el
[
mi_level
]
->
SkipData
(
*
m_es
,
EBML_CONTEXT
(
m_el
[
mi_level
])
);
if
(
!
mb_keep
)
if
(
!
mb_keep
)
{
{
if
(
MKV_IS_ID
(
m_el
[
mi_level
],
KaxBlockVirtual
)
)
if
(
MKV_IS_ID
(
m_el
[
mi_level
],
KaxBlockVirtual
)
)
...
@@ -177,7 +177,7 @@ EbmlElement *EbmlParser::Get( void )
...
@@ -177,7 +177,7 @@ EbmlElement *EbmlParser::Get( void )
mb_keep
=
false
;
mb_keep
=
false
;
}
}
m_el
[
mi_level
]
=
m_es
->
FindNextElement
(
m_el
[
mi_level
-
1
]
->
Generic
().
Context
,
i_ulev
,
0xFFFFFFFFL
,
mb_dummy
!=
0
,
1
);
m_el
[
mi_level
]
=
m_es
->
FindNextElement
(
EBML_CONTEXT
(
m_el
[
mi_level
-
1
])
,
i_ulev
,
0xFFFFFFFFL
,
mb_dummy
!=
0
,
1
);
// mi_remain_size[mi_level] = m_el[mi_level]->GetSize();
// mi_remain_size[mi_level] = m_el[mi_level]->GetSize();
if
(
i_ulev
>
0
)
if
(
i_ulev
>
0
)
{
{
...
...
modules/demux/mkv/demux.cpp
View file @
623f6fcf
...
@@ -56,7 +56,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
...
@@ -56,7 +56,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
bool
b_keep_stream
=
false
,
b_keep_segment
;
bool
b_keep_stream
=
false
,
b_keep_segment
;
// verify the EBML Header
// verify the EBML Header
p_l0
=
p_estream
->
FindNextID
(
E
bmlHead
::
ClassInfos
,
0xFFFFFFFFL
);
p_l0
=
p_estream
->
FindNextID
(
E
BML_INFO
(
EbmlHead
)
,
0xFFFFFFFFL
);
if
(
p_l0
==
NULL
)
if
(
p_l0
==
NULL
)
{
{
msg_Err
(
p_demux
,
"No EBML header found"
);
msg_Err
(
p_demux
,
"No EBML header found"
);
...
@@ -64,7 +64,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
...
@@ -64,7 +64,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
}
}
// verify we can read this Segment, we only support Matroska version 1 for now
// verify we can read this Segment, we only support Matroska version 1 for now
p_l0
->
Read
(
*
p_estream
,
E
bmlHead
::
ClassInfos
.
Context
,
i_upper_lvl
,
p_l0
,
true
);
p_l0
->
Read
(
*
p_estream
,
E
BML_CLASS_CONTEXT
(
EbmlHead
)
,
i_upper_lvl
,
p_l0
,
true
);
EDocType
doc_type
=
GetChild
<
EDocType
>
(
*
static_cast
<
EbmlHead
*>
(
p_l0
));
EDocType
doc_type
=
GetChild
<
EDocType
>
(
*
static_cast
<
EbmlHead
*>
(
p_l0
));
if
(
std
::
string
(
doc_type
)
!=
"matroska"
&&
std
::
string
(
doc_type
)
!=
"webm"
)
if
(
std
::
string
(
doc_type
)
!=
"matroska"
&&
std
::
string
(
doc_type
)
!=
"webm"
)
...
@@ -84,7 +84,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
...
@@ -84,7 +84,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
// find all segments in this file
// find all segments in this file
p_l0
=
p_estream
->
FindNextID
(
KaxSegment
::
ClassInfos
,
0xFFFFFFFFFLL
);
p_l0
=
p_estream
->
FindNextID
(
EBML_INFO
(
KaxSegment
)
,
0xFFFFFFFFFLL
);
if
(
p_l0
==
NULL
)
if
(
p_l0
==
NULL
)
{
{
return
NULL
;
return
NULL
;
...
@@ -111,7 +111,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
...
@@ -111,7 +111,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
// find the families of this segment
// find the families of this segment
KaxInfo
*
p_info
=
static_cast
<
KaxInfo
*>
(
p_l1
);
KaxInfo
*
p_info
=
static_cast
<
KaxInfo
*>
(
p_l1
);
p_info
->
Read
(
*
p_estream
,
KaxInfo
::
ClassInfos
.
Context
,
i_upper_lvl
,
p_l2
,
true
);
p_info
->
Read
(
*
p_estream
,
EBML_CLASS_CONTEXT
(
KaxInfo
)
,
i_upper_lvl
,
p_l2
,
true
);
for
(
i
=
0
;
i
<
p_info
->
ListSize
();
i
++
)
for
(
i
=
0
;
i
<
p_info
->
ListSize
();
i
++
)
{
{
EbmlElement
*
l
=
(
*
p_info
)[
i
];
EbmlElement
*
l
=
(
*
p_info
)[
i
];
...
@@ -157,7 +157,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
...
@@ -157,7 +157,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
if
(
p_l0
->
IsFiniteSize
()
)
if
(
p_l0
->
IsFiniteSize
()
)
{
{
p_l0
->
SkipData
(
*
p_estream
,
KaxMatroska_Context
);
p_l0
->
SkipData
(
*
p_estream
,
KaxMatroska_Context
);
p_l0
=
p_estream
->
FindNextID
(
KaxSegment
::
ClassInfos
,
0xFFFFFFFFL
);
p_l0
=
p_estream
->
FindNextID
(
EBML_INFO
(
KaxSegment
)
,
0xFFFFFFFFL
);
}
}
else
else
{
{
...
...
modules/demux/mkv/matroska_segment.cpp
View file @
623f6fcf
...
@@ -220,6 +220,7 @@ void matroska_segment_c::LoadTags( KaxTags *tags )
...
@@ -220,6 +220,7 @@ void matroska_segment_c::LoadTags( KaxTags *tags )
}
}
ep
->
Up
();
ep
->
Up
();
}
}
#if LIBMATROSKA_VERSION < 0x010100
else
if
(
MKV_IS_ID
(
el
,
KaxTagGeneral
)
)
else
if
(
MKV_IS_ID
(
el
,
KaxTagGeneral
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| + General"
);
msg_Dbg
(
&
sys
.
demuxer
,
"| + General"
);
...
@@ -288,6 +289,7 @@ void matroska_segment_c::LoadTags( KaxTags *tags )
...
@@ -288,6 +289,7 @@ void matroska_segment_c::LoadTags( KaxTags *tags )
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| + Multi Title"
);
msg_Dbg
(
&
sys
.
demuxer
,
"| + Multi Title"
);
}
}
#endif
else
else
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| + LoadTag Unknown (%s)"
,
typeid
(
*
el
).
name
()
);
msg_Dbg
(
&
sys
.
demuxer
,
"| + LoadTag Unknown (%s)"
,
typeid
(
*
el
).
name
()
);
...
...
modules/demux/mkv/matroska_segment_parse.cpp
View file @
623f6fcf
...
@@ -57,7 +57,7 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
...
@@ -57,7 +57,7 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
{
{
if
(
MKV_IS_ID
(
l
,
KaxSeek
)
)
if
(
MKV_IS_ID
(
l
,
KaxSeek
)
)
{
{
EbmlId
id
=
E
bmlVoid
::
ClassInfos
.
GlobalId
;
EbmlId
id
=
E
BML_ID
(
EbmlVoid
)
;
int64_t
i_pos
=
-
1
;
int64_t
i_pos
=
-
1
;
msg_Dbg
(
&
sys
.
demuxer
,
"| | + Seek"
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | + Seek"
);
...
@@ -86,40 +86,40 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
...
@@ -86,40 +86,40 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
if
(
i_pos
>=
0
)
if
(
i_pos
>=
0
)
{
{
if
(
id
==
KaxCues
::
ClassInfos
.
GlobalId
)
if
(
id
==
EBML_ID
(
KaxCues
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - cues at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - cues at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxCues
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxCues
)
,
i_pos
);
}
}
else
if
(
id
==
KaxInfo
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxInfo
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - info at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - info at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxInfo
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxInfo
)
,
i_pos
);
}
}
else
if
(
id
==
KaxChapters
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxChapters
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - chapters at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - chapters at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxChapters
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxChapters
)
,
i_pos
);
}
}
else
if
(
id
==
KaxTags
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxTags
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - tags at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - tags at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxTags
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxTags
)
,
i_pos
);
}
}
else
if
(
id
==
KaxSeekHead
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxSeekHead
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - chained seekhead at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - chained seekhead at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxSeekHead
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxSeekHead
)
,
i_pos
);
}
}
else
if
(
id
==
KaxTracks
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxTracks
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - tracks at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - tracks at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxTracks
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxTracks
)
,
i_pos
);
}
}
else
if
(
id
==
KaxAttachments
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxAttachments
)
)
{
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - attachments at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - attachments at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxAttachments
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxAttachments
)
,
i_pos
);
}
}
else
else
msg_Dbg
(
&
sys
.
demuxer
,
"| - unknown seekhead reference at %"
PRId64
,
i_pos
);
msg_Dbg
(
&
sys
.
demuxer
,
"| - unknown seekhead reference at %"
PRId64
,
i_pos
);
...
@@ -654,7 +654,7 @@ void matroska_segment_c::ParseTracks( KaxTracks *tracks )
...
@@ -654,7 +654,7 @@ void matroska_segment_c::ParseTracks( KaxTracks *tracks )
int
i_upper_level
=
0
;
int
i_upper_level
=
0
;
/* Master elements */
/* Master elements */
tracks
->
Read
(
es
,
tracks
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
tracks
->
Read
(
es
,
EBML_CONTEXT
(
tracks
)
,
i_upper_level
,
el
,
true
);
for
(
i
=
0
;
i
<
tracks
->
ListSize
();
i
++
)
for
(
i
=
0
;
i
<
tracks
->
ListSize
();
i
++
)
{
{
...
@@ -683,7 +683,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
...
@@ -683,7 +683,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
/* Master elements */
/* Master elements */
m
=
static_cast
<
EbmlMaster
*>
(
info
);
m
=
static_cast
<
EbmlMaster
*>
(
info
);
m
->
Read
(
es
,
info
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
m
->
Read
(
es
,
EBML_CONTEXT
(
info
)
,
i_upper_level
,
el
,
true
);
for
(
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
for
(
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
{
{
...
@@ -792,7 +792,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
...
@@ -792,7 +792,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
KaxChapterTranslate
*
p_trans
=
static_cast
<
KaxChapterTranslate
*>
(
l
);
KaxChapterTranslate
*
p_trans
=
static_cast
<
KaxChapterTranslate
*>
(
l
);
chapter_translation_c
*
p_translate
=
new
chapter_translation_c
();
chapter_translation_c
*
p_translate
=
new
chapter_translation_c
();
p_trans
->
Read
(
es
,
p_trans
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
p_trans
->
Read
(
es
,
EBML_CONTEXT
(
p_trans
)
,
i_upper_level
,
el
,
true
);
for
(
j
=
0
;
j
<
p_trans
->
ListSize
();
j
++
)
for
(
j
=
0
;
j
<
p_trans
->
ListSize
();
j
++
)
{
{
EbmlElement
*
l
=
(
*
p_trans
)[
j
];
EbmlElement
*
l
=
(
*
p_trans
)[
j
];
...
@@ -961,7 +961,7 @@ void matroska_segment_c::ParseAttachments( KaxAttachments *attachments )
...
@@ -961,7 +961,7 @@ void matroska_segment_c::ParseAttachments( KaxAttachments *attachments )
EbmlElement
*
el
;
EbmlElement
*
el
;
int
i_upper_level
=
0
;
int
i_upper_level
=
0
;
attachments
->
Read
(
es
,
attachments
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
attachments
->
Read
(
es
,
EBML_CONTEXT
(
attachments
)
,
i_upper_level
,
el
,
true
);
KaxAttached
*
attachedFile
=
FindChild
<
KaxAttached
>
(
*
attachments
);
KaxAttached
*
attachedFile
=
FindChild
<
KaxAttached
>
(
*
attachments
);
...
@@ -1006,7 +1006,7 @@ void matroska_segment_c::ParseChapters( KaxChapters *chapters )
...
@@ -1006,7 +1006,7 @@ void matroska_segment_c::ParseChapters( KaxChapters *chapters )
mtime_t
i_dur
;
mtime_t
i_dur
;
/* Master elements */
/* Master elements */
chapters
->
Read
(
es
,
chapters
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
chapters
->
Read
(
es
,
EBML_CONTEXT
(
chapters
)
,
i_upper_level
,
el
,
true
);
for
(
i
=
0
;
i
<
chapters
->
ListSize
();
i
++
)
for
(
i
=
0
;
i
<
chapters
->
ListSize
();
i
++
)
{
{
...
@@ -1078,7 +1078,7 @@ void matroska_segment_c::ParseCluster( )
...
@@ -1078,7 +1078,7 @@ void matroska_segment_c::ParseCluster( )
/* Master elements */
/* Master elements */
m
=
static_cast
<
EbmlMaster
*>
(
cluster
);
m
=
static_cast
<
EbmlMaster
*>
(
cluster
);
m
->
Read
(
es
,
cluster
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
m
->
Read
(
es
,
EBML_CONTEXT
(
cluster
)
,
i_upper_level
,
el
,
true
);
for
(
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
for
(
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
{
{
...
...
modules/demux/mkv/mkv.hpp
View file @
623f6fcf
...
@@ -92,13 +92,15 @@
...
@@ -92,13 +92,15 @@
#include "matroska/KaxSegment.h"
#include "matroska/KaxSegment.h"
#include "matroska/KaxTag.h"
#include "matroska/KaxTag.h"
#include "matroska/KaxTags.h"
#include "matroska/KaxTags.h"
#include "matroska/KaxVersion.h"
#if LIBMATROSKA_VERSION < 0x010100
#include "matroska/KaxTagMulti.h"
#include "matroska/KaxTagMulti.h"
#endif
#include "matroska/KaxTracks.h"
#include "matroska/KaxTracks.h"
#include "matroska/KaxTrackAudio.h"
#include "matroska/KaxTrackAudio.h"
#include "matroska/KaxTrackVideo.h"
#include "matroska/KaxTrackVideo.h"
#include "matroska/KaxTrackEntryData.h"
#include "matroska/KaxTrackEntryData.h"
#include "matroska/KaxContentEncoding.h"
#include "matroska/KaxContentEncoding.h"
#include "matroska/KaxVersion.h"
#include "ebml/StdIOCallback.h"
#include "ebml/StdIOCallback.h"
...
@@ -121,6 +123,12 @@ extern "C" {
...
@@ -121,6 +123,12 @@ extern "C" {
#define MKV_IS_ID( el, C ) ( el != NULL && typeid( *el ) == typeid( C ) )
#define MKV_IS_ID( el, C ) ( el != NULL && typeid( *el ) == typeid( C ) )
#if LIBEBML_VERSION < 0x010000
#define EBML_INFO(ref) ref::ClassInfos
#define EBML_ID(ref) ref::ClassInfos.GlobalId
#define EBML_CLASS_CONTEXT(ref) ref::ClassInfos.Context
#define EBML_CONTEXT(e) (e)->Generic().Context
#endif
using
namespace
LIBMATROSKA_NAMESPACE
;
using
namespace
LIBMATROSKA_NAMESPACE
;
using
namespace
std
;
using
namespace
std
;
...
...
po/fr.po
View file @
623f6fcf
...
@@ -25259,9 +25259,9 @@ msgid ""
...
@@ -25259,9 +25259,9 @@ msgid ""
msgstr ""
msgstr ""
"Votre pilote vidéo ne supporte pas la résolution demandée : %ux%u pixels. La "
"Votre pilote vidéo ne supporte pas la résolution demandée : %ux%u pixels. La "
"résolution maximale supportée est %
<PRIu32>
x%
<PRIu32>
.\n"
"résolution maximale supportée est %
<PRIu32>
x%
<PRIu32>
.\n"
"La sortie vidéo accéléré sera inhibée. Cependant, utiliser des résolutions "
"La sortie vidéo accéléré
e
sera inhibée. Cependant, utiliser des résolutions "
"très grandes pour la vidéo
est souvent case de sévères dégradations de la
"
"très grandes pour la vidéo
peut provoquer de fortes dégradations des
"
"performance."
"performance
s
."
#: modules/video_output/yuv.c:41
#: modules/video_output/yuv.c:41
msgid "device, fifo or filename"
msgid "device, fifo or filename"
...
...
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