Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
8f447e01
Commit
8f447e01
authored
Mar 30, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used var_Inherit* in imem.
parent
b21cad66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
modules/access/imem.c
modules/access/imem.c
+24
-24
No files found.
modules/access/imem.c
View file @
8f447e01
...
...
@@ -224,10 +224,10 @@ typedef struct {
}
imem_sys_t
;
static
void
ParseMRL
(
vlc_object_t
*
,
const
char
*
);
#define var_
CreateGetRational(a,b,c,d) var_CreateGe
tRational(VLC_OBJECT(a),b,c,d)
static
int
(
var_
CreateGe
tRational
)(
vlc_object_t
*
,
unsigned
*
num
,
unsigned
*
den
,
const
char
*
var
);
#define var_
InheritRational(a,b,c,d) var_Inheri
tRational(VLC_OBJECT(a),b,c,d)
static
int
(
var_
Inheri
tRational
)(
vlc_object_t
*
,
unsigned
*
num
,
unsigned
*
den
,
const
char
*
var
);
/**
* It closes the common part of the access and access_demux
...
...
@@ -251,12 +251,12 @@ static int OpenCommon(vlc_object_t *object, imem_sys_t **sys_ptr, const char *ps
return
VLC_ENOMEM
;
/* Read the user functions */
tmp
=
var_
CreateGe
tString
(
object
,
"imem-get"
);
tmp
=
var_
Inheri
tString
(
object
,
"imem-get"
);
if
(
tmp
)
sys
->
source
.
get
=
(
imem_get_t
)(
intptr_t
)
strtoll
(
tmp
,
NULL
,
0
);
free
(
tmp
);
tmp
=
var_
CreateGe
tString
(
object
,
"imem-release"
);
tmp
=
var_
Inheri
tString
(
object
,
"imem-release"
);
if
(
tmp
)
sys
->
source
.
release
=
(
imem_release_t
)(
intptr_t
)
strtoll
(
tmp
,
NULL
,
0
);
free
(
tmp
);
...
...
@@ -267,7 +267,7 @@ static int OpenCommon(vlc_object_t *object, imem_sys_t **sys_ptr, const char *ps
return
VLC_EGENERIC
;
}
tmp
=
var_
CreateGe
tString
(
object
,
"imem-data"
);
tmp
=
var_
Inheri
tString
(
object
,
"imem-data"
);
if
(
tmp
)
sys
->
source
.
data
=
(
void
*
)(
uintptr_t
)
strtoull
(
tmp
,
NULL
,
0
);
free
(
tmp
);
...
...
@@ -284,7 +284,7 @@ static int OpenCommon(vlc_object_t *object, imem_sys_t **sys_ptr, const char *ps
sys
->
source
.
cookie
?
sys
->
source
.
cookie
:
"(null)"
);
/* */
sys
->
pts_delay
=
var_
CreateGe
tInteger
(
object
,
"imem-caching"
)
*
INT64_C
(
1000
);
sys
->
pts_delay
=
var_
Inheri
tInteger
(
object
,
"imem-caching"
)
*
INT64_C
(
1000
);
sys
->
dts
=
0
;
sys
->
deadline
=
VLC_TS_INVALID
;
...
...
@@ -415,10 +415,10 @@ static int OpenDemux(vlc_object_t *object)
es_format_t
fmt
;
es_format_Init
(
&
fmt
,
UNKNOWN_ES
,
0
);
fmt
.
i_id
=
var_
CreateGe
tInteger
(
object
,
"imem-id"
);
fmt
.
i_group
=
var_
CreateGe
tInteger
(
object
,
"imem-group"
);
fmt
.
i_id
=
var_
Inheri
tInteger
(
object
,
"imem-id"
);
fmt
.
i_group
=
var_
Inheri
tInteger
(
object
,
"imem-group"
);
char
*
tmp
=
var_
CreateGe
tString
(
object
,
"imem-codec"
);
char
*
tmp
=
var_
Inheri
tString
(
object
,
"imem-codec"
);
if
(
tmp
)
fmt
.
i_codec
=
vlc_fourcc_GetCodecFromString
(
UNKNOWN_ES
,
tmp
);
free
(
tmp
);
...
...
@@ -427,8 +427,8 @@ static int OpenDemux(vlc_object_t *object)
switch
(
cat
)
{
case
1
:
{
fmt
.
i_cat
=
AUDIO_ES
;
fmt
.
audio
.
i_channels
=
var_
CreateGe
tInteger
(
object
,
"imem-channels"
);
fmt
.
audio
.
i_rate
=
var_
CreateGe
tInteger
(
object
,
"imem-samplerate"
);
fmt
.
audio
.
i_channels
=
var_
Inheri
tInteger
(
object
,
"imem-channels"
);
fmt
.
audio
.
i_rate
=
var_
Inheri
tInteger
(
object
,
"imem-samplerate"
);
msg_Dbg
(
object
,
"Audio %4.4s %d channels %d Hz"
,
(
const
char
*
)
&
fmt
.
i_codec
,
...
...
@@ -437,16 +437,16 @@ static int OpenDemux(vlc_object_t *object)
}
case
2
:
{
fmt
.
i_cat
=
VIDEO_ES
;
fmt
.
video
.
i_width
=
var_
CreateGe
tInteger
(
object
,
"imem-width"
);
fmt
.
video
.
i_height
=
var_
CreateGe
tInteger
(
object
,
"imem-height"
);
fmt
.
video
.
i_width
=
var_
Inheri
tInteger
(
object
,
"imem-width"
);
fmt
.
video
.
i_height
=
var_
Inheri
tInteger
(
object
,
"imem-height"
);
unsigned
num
,
den
;
if
(
!
var_
CreateGe
tRational
(
object
,
&
num
,
&
den
,
"imem-dar"
)
&&
num
>
0
&&
den
>
0
)
{
if
(
!
var_
Inheri
tRational
(
object
,
&
num
,
&
den
,
"imem-dar"
)
&&
num
>
0
&&
den
>
0
)
{
if
(
fmt
.
video
.
i_width
>
0
&&
fmt
.
video
.
i_height
>
0
)
{
fmt
.
video
.
i_sar_num
=
num
*
fmt
.
video
.
i_height
;
fmt
.
video
.
i_sar_den
=
den
*
fmt
.
video
.
i_width
;
}
}
if
(
!
var_
CreateGe
tRational
(
object
,
&
num
,
&
den
,
"imem-fps"
)
&&
num
>
0
&&
den
>
0
)
{
if
(
!
var_
Inheri
tRational
(
object
,
&
num
,
&
den
,
"imem-fps"
)
&&
num
>
0
&&
den
>
0
)
{
fmt
.
video
.
i_frame_rate
=
num
;
fmt
.
video
.
i_frame_rate_base
=
den
;
}
...
...
@@ -461,9 +461,9 @@ static int OpenDemux(vlc_object_t *object)
case
3
:
{
fmt
.
i_cat
=
SPU_ES
;
fmt
.
subs
.
spu
.
i_original_frame_width
=
var_
CreateGe
tInteger
(
object
,
"imem-width"
);
var_
Inheri
tInteger
(
object
,
"imem-width"
);
fmt
.
subs
.
spu
.
i_original_frame_height
=
var_
CreateGe
tInteger
(
object
,
"imem-height"
);
var_
Inheri
tInteger
(
object
,
"imem-height"
);
msg_Dbg
(
object
,
"Subtitle %4.4s"
,
(
const
char
*
)
&
fmt
.
i_codec
);
...
...
@@ -477,7 +477,7 @@ static int OpenDemux(vlc_object_t *object)
return
VLC_EGENERIC
;
}
fmt
.
psz_language
=
var_
CreateGe
tString
(
object
,
"imem-language"
);
fmt
.
psz_language
=
var_
Inheri
tString
(
object
,
"imem-language"
);
sys
->
es
=
es_out_Add
(
demux
->
out
,
&
fmt
);
es_format_Clean
(
&
fmt
);
...
...
@@ -615,16 +615,16 @@ static int Demux(demux_t *demux)
*
* It returns an error if the rational number cannot be parsed (0/0 is valid).
*/
static
int
(
var_
CreateGe
tRational
)(
vlc_object_t
*
object
,
unsigned
*
num
,
unsigned
*
den
,
const
char
*
var
)
static
int
(
var_
Inheri
tRational
)(
vlc_object_t
*
object
,
unsigned
*
num
,
unsigned
*
den
,
const
char
*
var
)
{
/* */
*
num
=
0
;
*
den
=
0
;
/* */
char
*
tmp
=
var_
CreateGe
tString
(
object
,
var
);
char
*
tmp
=
var_
Inheri
tString
(
object
,
var
);
if
(
!
tmp
)
goto
error
;
...
...
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