Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
c5746ee2
Commit
c5746ee2
authored
Mar 01, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spell resource the English way
parent
195597f3
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
552 additions
and
96 deletions
+552
-96
src/Makefile.am
src/Makefile.am
+2
-2
src/input/control.c
src/input/control.c
+3
-3
src/input/decoder.c
src/input/decoder.c
+11
-11
src/input/es_out.c
src/input/es_out.c
+3
-3
src/input/input.c
src/input/input.c
+23
-23
src/input/input_interface.h
src/input/input_interface.h
+14
-14
src/input/input_internal.h
src/input/input_internal.h
+1
-1
src/input/resource.c
src/input/resource.c
+456
-0
src/input/resource.h
src/input/resource.h
+10
-10
src/input/vlm.c
src/input/vlm.c
+11
-11
src/input/vlm_internal.h
src/input/vlm_internal.h
+1
-1
src/misc/messages.c
src/misc/messages.c
+1
-1
src/playlist/engine.c
src/playlist/engine.c
+1
-1
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+1
-1
src/playlist/thread.c
src/playlist/thread.c
+14
-14
No files found.
src/Makefile.am
View file @
c5746ee2
...
...
@@ -308,8 +308,8 @@ SOURCES_libvlc_common = \
input/input_internal.h
\
input/input_interface.h
\
input/vlm_internal.h
\
input/res
s
ource.h
\
input/res
s
ource.c
\
input/resource.h
\
input/resource.c
\
input/stream.c
\
input/stream_demux.c
\
input/stream_filter.c
\
...
...
src/input/control.c
View file @
c5746ee2
...
...
@@ -32,7 +32,7 @@
#include "input_internal.h"
#include "event.h"
#include "res
s
ource.h"
#include "resource.h"
static
void
UpdateBookmarksOption
(
input_thread_t
*
);
...
...
@@ -415,7 +415,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
case
INPUT_GET_AOUT
:
{
aout_instance_t
*
p_aout
=
input_res
source_HoldAout
(
p_input
->
p
->
p_res
source
);
aout_instance_t
*
p_aout
=
input_res
ource_HoldAout
(
p_input
->
p
->
p_re
source
);
if
(
!
p_aout
)
return
VLC_EGENERIC
;
...
...
@@ -429,7 +429,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vout_thread_t
***
ppp_vout
=
(
vout_thread_t
***
)
va_arg
(
args
,
vout_thread_t
***
);
int
*
pi_vout
=
(
int
*
)
va_arg
(
args
,
int
*
);
input_res
source_HoldVouts
(
p_input
->
p
->
p_res
source
,
ppp_vout
,
pi_vout
);
input_res
ource_HoldVouts
(
p_input
->
p
->
p_re
source
,
ppp_vout
,
pi_vout
);
if
(
*
pi_vout
<=
0
)
return
VLC_EGENERIC
;
return
VLC_SUCCESS
;
...
...
src/input/decoder.c
View file @
c5746ee2
...
...
@@ -48,7 +48,7 @@
#include "clock.h"
#include "decoder.h"
#include "event.h"
#include "res
s
ource.h"
#include "resource.h"
#include "../video_output/vout_control.h"
...
...
@@ -1887,7 +1887,7 @@ static void DecoderProcessSpu( decoder_t *p_dec, block_t *p_block, bool b_flush
stats_UpdateInteger
(
p_dec
,
p_input
->
p
->
counters
.
p_decoded_sub
,
1
,
NULL
);
vlc_mutex_unlock
(
&
p_input
->
p
->
counters
.
counters_lock
);
p_vout
=
input_res
source_HoldVout
(
p_input
->
p
->
p_res
source
);
p_vout
=
input_res
ource_HoldVout
(
p_input
->
p
->
p_re
source
);
if
(
p_vout
&&
p_owner
->
p_spu_vout
==
p_vout
)
{
/* Preroll does not work very well with subtitle */
...
...
@@ -1912,7 +1912,7 @@ static void DecoderProcessSpu( decoder_t *p_dec, block_t *p_block, bool b_flush
if
(
b_flush
&&
p_owner
->
p_spu_vout
)
{
p_vout
=
input_res
source_HoldVout
(
p_input
->
p
->
p_res
source
);
p_vout
=
input_res
ource_HoldVout
(
p_input
->
p
->
p_re
source
);
if
(
p_vout
&&
p_owner
->
p_spu_vout
==
p_vout
)
spu_Control
(
p_vout
->
p_spu
,
SPU_CHANNEL_CLEAR
,
...
...
@@ -2041,7 +2041,7 @@ static void DeleteDecoder( decoder_t * p_dec )
aout_DecDelete
(
p_owner
->
p_aout
,
p_owner
->
p_aout_input
);
if
(
p_owner
->
p_aout
)
{
input_res
source_RequestAout
(
p_owner
->
p_input
->
p
->
p_res
source
,
input_res
ource_RequestAout
(
p_owner
->
p_input
->
p
->
p_re
source
,
p_owner
->
p_aout
);
input_SendEventAout
(
p_owner
->
p_input
);
p_owner
->
p_aout
=
NULL
;
...
...
@@ -2055,7 +2055,7 @@ static void DeleteDecoder( decoder_t * p_dec )
vout_ChangePause
(
p_owner
->
p_vout
,
false
,
mdate
()
);
/* */
input_res
source_RequestVout
(
p_owner
->
p_input
->
p
->
p_res
source
,
p_owner
->
p_vout
,
NULL
,
true
);
input_res
ource_RequestVout
(
p_owner
->
p_input
->
p
->
p_re
source
,
p_owner
->
p_vout
,
NULL
,
true
);
input_SendEventVout
(
p_owner
->
p_input
);
}
...
...
@@ -2071,7 +2071,7 @@ static void DeleteDecoder( decoder_t * p_dec )
{
vout_thread_t
*
p_vout
;
p_vout
=
input_res
source_HoldVout
(
p_owner
->
p_input
->
p
->
p_res
source
);
p_vout
=
input_res
ource_HoldVout
(
p_owner
->
p_input
->
p
->
p_re
source
);
if
(
p_vout
)
{
if
(
p_owner
->
p_spu_vout
==
p_vout
)
...
...
@@ -2135,7 +2135,7 @@ static vout_thread_t *aout_request_vout( void *p_private,
decoder_t
*
p_dec
=
p_private
;
input_thread_t
*
p_input
=
p_dec
->
p_owner
->
p_input
;
p_vout
=
input_res
source_RequestVout
(
p_input
->
p
->
p_res
source
,
p_vout
,
p_fmt
,
b_recyle
);
p_vout
=
input_res
ource_RequestVout
(
p_input
->
p
->
p_re
source
,
p_vout
,
p_fmt
,
b_recyle
);
input_SendEventVout
(
p_input
);
return
p_vout
;
...
...
@@ -2199,7 +2199,7 @@ static aout_buffer_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
p_aout
=
p_owner
->
p_aout
;
if
(
!
p_aout
)
p_aout
=
input_res
source_RequestAout
(
p_owner
->
p_input
->
p
->
p_res
source
,
NULL
);
p_aout
=
input_res
ource_RequestAout
(
p_owner
->
p_input
->
p
->
p_re
source
,
NULL
);
p_aout_input
=
aout_DecNew
(
p_dec
,
&
p_aout
,
&
format
,
&
p_dec
->
fmt_out
.
audio_replay_gain
,
&
request_vout
);
...
...
@@ -2313,7 +2313,7 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
p_owner
->
p_vout
=
NULL
;
vlc_mutex_unlock
(
&
p_owner
->
lock
);
p_vout
=
input_res
source_RequestVout
(
p_owner
->
p_input
->
p
->
p_res
source
,
p_vout
=
input_res
ource_RequestVout
(
p_owner
->
p_input
->
p
->
p_re
source
,
p_vout
,
&
p_dec
->
fmt_out
.
video
,
true
);
vlc_mutex_lock
(
&
p_owner
->
lock
);
...
...
@@ -2401,7 +2401,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec )
if
(
p_dec
->
b_die
||
p_dec
->
b_error
)
break
;
p_vout
=
input_res
source_HoldVout
(
p_owner
->
p_input
->
p
->
p_res
source
);
p_vout
=
input_res
ource_HoldVout
(
p_owner
->
p_input
->
p
->
p_re
source
);
if
(
p_vout
)
break
;
...
...
@@ -2446,7 +2446,7 @@ static void spu_del_buffer( decoder_t *p_dec, subpicture_t *p_subpic )
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vout_thread_t
*
p_vout
=
NULL
;
p_vout
=
input_res
source_HoldVout
(
p_owner
->
p_input
->
p
->
p_res
source
);
p_vout
=
input_res
ource_HoldVout
(
p_owner
->
p_input
->
p
->
p_re
source
);
if
(
!
p_vout
||
p_owner
->
p_spu_vout
!=
p_vout
)
{
if
(
p_vout
)
...
...
src/input/es_out.c
View file @
c5746ee2
...
...
@@ -670,7 +670,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
(
int
)(
mdate
()
-
i_decoder_buffering_start
)
/
1000
);
/* Here is a good place to destroy unused vout with every demuxer */
input_res
source_TerminateVout
(
p_sys
->
p_input
->
p
->
p_res
source
);
input_res
ource_TerminateVout
(
p_sys
->
p_input
->
p
->
p_re
source
);
/* */
const
mtime_t
i_wakeup_delay
=
10
*
1000
;
/* FIXME CLEANUP thread wake up time*/
...
...
@@ -2040,7 +2040,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
break
;
}
if
(
i
>=
p_sys
->
i_es
)
input_res
source_TerminateVout
(
p_sys
->
p_input
->
p
->
p_res
source
);
input_res
ource_TerminateVout
(
p_sys
->
p_input
->
p
->
p_re
source
);
}
p_sys
->
b_active
=
b
;
return
VLC_SUCCESS
;
...
...
@@ -2317,7 +2317,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
/* Clean up vout after user action (in active mode only).
* FIXME it does not work well with multiple video windows */
if
(
p_sys
->
b_active
)
input_res
source_TerminateVout
(
p_sys
->
p_input
->
p
->
p_res
source
);
input_res
ource_TerminateVout
(
p_sys
->
p_input
->
p
->
p_re
source
);
return
i_ret
;
}
...
...
src/input/input.c
View file @
c5746ee2
...
...
@@ -43,7 +43,7 @@
#include "demux.h"
#include "stream.h"
#include "item.h"
#include "res
s
ource.h"
#include "resource.h"
#include <vlc_sout.h>
#include "../stream_output/stream_output.h"
...
...
@@ -66,7 +66,7 @@ static void *Run ( vlc_object_t *p_this );
static
void
*
RunAndDestroy
(
vlc_object_t
*
p_this
);
static
input_thread_t
*
Create
(
vlc_object_t
*
,
input_item_t
*
,
const
char
*
,
bool
,
input_res
s
ource_t
*
);
const
char
*
,
bool
,
input_resource_t
*
);
static
int
Init
(
input_thread_t
*
p_input
);
static
void
End
(
input_thread_t
*
p_input
);
static
void
MainLoop
(
input_thread_t
*
p_input
);
...
...
@@ -117,7 +117,7 @@ static void input_ChangeState( input_thread_t *p_input, int i_state ); /* TODO f
*****************************************************************************/
static
input_thread_t
*
Create
(
vlc_object_t
*
p_parent
,
input_item_t
*
p_item
,
const
char
*
psz_header
,
bool
b_quick
,
input_res
source_t
*
p_res
source
)
input_res
ource_t
*
p_re
source
)
{
static
const
char
input_name
[]
=
"input"
;
input_thread_t
*
p_input
=
NULL
;
/* thread descriptor */
...
...
@@ -200,11 +200,11 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
p_input
->
p
->
slave
=
NULL
;
/* */
if
(
p_res
s
ource
)
p_input
->
p
->
p_res
source
=
p_res
source
;
if
(
p_resource
)
p_input
->
p
->
p_res
ource
=
p_re
source
;
else
p_input
->
p
->
p_res
source
=
input_res
source_New
();
input_res
source_SetInput
(
p_input
->
p
->
p_res
source
,
p_input
);
p_input
->
p
->
p_res
ource
=
input_re
source_New
();
input_res
ource_SetInput
(
p_input
->
p
->
p_re
source
,
p_input
);
/* Init control buffer */
vlc_mutex_init
(
&
p_input
->
p
->
lock_control
);
...
...
@@ -311,8 +311,8 @@ static void Destructor( input_thread_t * p_input )
stats_TimerDump
(
p_input
,
STATS_TIMER_INPUT_LAUNCHING
);
stats_TimerClean
(
p_input
,
STATS_TIMER_INPUT_LAUNCHING
);
if
(
p_input
->
p
->
p_res
s
ource
)
input_res
source_Delete
(
p_input
->
p
->
p_res
source
);
if
(
p_input
->
p
->
p_resource
)
input_res
ource_Delete
(
p_input
->
p
->
p_re
source
);
vlc_gc_decref
(
p_input
->
p
->
p_item
);
...
...
@@ -340,11 +340,11 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
/* */
input_thread_t
*
__input_CreateThreadExtended
(
vlc_object_t
*
p_parent
,
input_item_t
*
p_item
,
const
char
*
psz_log
,
input_res
source_t
*
p_res
source
)
const
char
*
psz_log
,
input_res
ource_t
*
p_re
source
)
{
input_thread_t
*
p_input
;
p_input
=
Create
(
p_parent
,
p_item
,
psz_log
,
false
,
p_res
s
ource
);
p_input
=
Create
(
p_parent
,
p_item
,
psz_log
,
false
,
p_resource
);
if
(
!
p_input
)
return
NULL
;
...
...
@@ -440,17 +440,17 @@ void input_StopThread( input_thread_t *p_input )
input_ControlPush
(
p_input
,
INPUT_CONTROL_SET_DIE
,
NULL
);
}
input_res
s
ource_t
*
input_DetachRessource
(
input_thread_t
*
p_input
)
input_resource_t
*
input_DetachRessource
(
input_thread_t
*
p_input
)
{
assert
(
p_input
->
b_dead
);
input_res
source_t
*
p_ressource
=
p_input
->
p
->
p_res
source
;
input_res
source_SetInput
(
p_res
source
,
NULL
);
input_res
ource_t
*
p_resource
=
p_input
->
p
->
p_re
source
;
input_res
ource_SetInput
(
p_re
source
,
NULL
);
p_input
->
p
->
p_res
s
ource
=
NULL
;
p_input
->
p
->
p_resource
=
NULL
;
p_input
->
p
->
p_sout
=
NULL
;
return
p_res
s
ource
;
return
p_resource
;
}
/**
...
...
@@ -829,7 +829,7 @@ static int InitSout( input_thread_t * p_input )
char
*
psz
=
var_GetNonEmptyString
(
p_input
,
"sout"
);
if
(
psz
&&
strncasecmp
(
p_input
->
p
->
p_item
->
psz_uri
,
"vlc:"
,
4
)
)
{
p_input
->
p
->
p_sout
=
input_res
source_RequestSout
(
p_input
->
p
->
p_res
source
,
NULL
,
psz
);
p_input
->
p
->
p_sout
=
input_res
ource_RequestSout
(
p_input
->
p
->
p_re
source
,
NULL
,
psz
);
if
(
!
p_input
->
p
->
p_sout
)
{
input_ChangeState
(
p_input
,
ERROR_S
);
...
...
@@ -850,7 +850,7 @@ static int InitSout( input_thread_t * p_input )
}
else
{
input_res
source_RequestSout
(
p_input
->
p
->
p_res
source
,
NULL
,
NULL
);
input_res
ource_RequestSout
(
p_input
->
p
->
p_re
source
,
NULL
,
NULL
);
}
free
(
psz
);
...
...
@@ -1215,12 +1215,12 @@ error:
es_out_Delete
(
p_input
->
p
->
p_es_out
);
if
(
p_input
->
p
->
p_es_out_display
)
es_out_Delete
(
p_input
->
p
->
p_es_out_display
);
if
(
p_input
->
p
->
p_res
s
ource
)
if
(
p_input
->
p
->
p_resource
)
{
if
(
p_input
->
p
->
p_sout
)
input_res
source_RequestSout
(
p_input
->
p
->
p_res
source
,
input_res
ource_RequestSout
(
p_input
->
p
->
p_re
source
,
p_input
->
p
->
p_sout
,
NULL
);
input_res
source_SetInput
(
p_input
->
p
->
p_res
source
,
NULL
);
input_res
ource_SetInput
(
p_input
->
p
->
p_re
source
,
NULL
);
}
#ifdef ENABLE_SOUT
...
...
@@ -1339,9 +1339,9 @@ static void End( input_thread_t * p_input )
}
/* */
input_res
source_RequestSout
(
p_input
->
p
->
p_res
source
,
input_res
ource_RequestSout
(
p_input
->
p
->
p_re
source
,
p_input
->
p
->
p_sout
,
NULL
);
input_res
source_SetInput
(
p_input
->
p
->
p_res
source
,
NULL
);
input_res
ource_SetInput
(
p_input
->
p
->
p_re
source
,
NULL
);
}
/*****************************************************************************
...
...
src/input/input_interface.h
View file @
c5746ee2
...
...
@@ -45,44 +45,44 @@ int input_Preparse( vlc_object_t *, input_item_t * );
input_stats_t
*
stats_NewInputStats
(
input_thread_t
*
p_input
);
/**
* This defines an opaque input res
s
ource handler.
* This defines an opaque input resource handler.
*/
typedef
struct
input_res
source_t
input_res
source_t
;
typedef
struct
input_res
ource_t
input_re
source_t
;
/**
* This function releases an input_res
source_t and all associated res
sources.
* This function releases an input_res
ource_t and all associated re
sources.
*/
void
input_res
source_Delete
(
input_res
source_t
*
);
void
input_res
ource_Delete
(
input_re
source_t
*
);
/**
* This function deletes the current sout in the res
s
ources.
* This function deletes the current sout in the resources.
*/
void
input_res
source_TerminateSout
(
input_ressource_t
*
p_res
source
);
void
input_res
ource_TerminateSout
(
input_resource_t
*
p_re
source
);
/**
* This function deletes the current vout in the res
s
ources.
* This function deletes the current vout in the resources.
*/
void
input_res
source_TerminateVout
(
input_ressource_t
*
p_res
source
);
void
input_res
ource_TerminateVout
(
input_resource_t
*
p_re
source
);
/**
* This function return true if there is at least one vout in the res
s
ources.
* This function return true if there is at least one vout in the resources.
*
* It can only be called on detached res
s
ources.
* It can only be called on detached resources.
*/
bool
input_res
source_HasVout
(
input_ressource_t
*
p_res
source
);
bool
input_res
ource_HasVout
(
input_resource_t
*
p_re
source
);
/* input.c */
#define input_CreateThreadExtended(a,b,c,d) __input_CreateThreadExtended(VLC_OBJECT(a),b,c,d)
input_thread_t
*
__input_CreateThreadExtended
(
vlc_object_t
*
,
input_item_t
*
,
const
char
*
,
input_res
s
ource_t
*
);
input_thread_t
*
__input_CreateThreadExtended
(
vlc_object_t
*
,
input_item_t
*
,
const
char
*
,
input_resource_t
*
);
/**
* This function detaches res
s
ources from a dead input.
* This function detaches resources from a dead input.
*
* It MUST be called on a dead input (p_input->b_dead true) otherwise
* it will assert.
* It does not support concurrent calls.
*/
input_res
s
ource_t
*
input_DetachRessource
(
input_thread_t
*
);
input_resource_t
*
input_DetachRessource
(
input_thread_t
*
);
/* */
typedef
enum
...
...
src/input/input_internal.h
View file @
c5746ee2
...
...
@@ -130,7 +130,7 @@ struct input_thread_private_t
input_source_t
**
slave
;
/* Ressources */
input_res
source_t
*
p_res
source
;
input_res
ource_t
*
p_re
source
;
/* Stats counters */
struct
{
...
...
src/input/res
s
ource.c
→
src/input/resource.c
View file @
c5746ee2
/*****************************************************************************
* res
s
ource.c
* resource.c
*****************************************************************************
* Copyright (C) 2008 Laurent Aimar
* $Id$
...
...
@@ -38,9 +38,9 @@
#include "../audio_output/aout_internal.h"
#include "../video_output/vout_control.h"
#include "input_interface.h"
#include "res
s
ource.h"
#include "resource.h"
struct
input_res
s
ource_t
struct
input_resource_t
{
/* This lock is used to serialize request and protect
* our variables */
...
...
@@ -53,7 +53,7 @@ struct input_ressource_t
vout_thread_t
*
p_vout_free
;
aout_instance_t
*
p_aout
;
/* This lock is used to protect vout res
s
ources access (for hold)
/* This lock is used to protect vout resources access (for hold)
* It is a special case because of embed video (possible deadlock
* between vout window request and vout holds in some(qt4) interface) */
vlc_mutex_t
lock_vout
;
...
...
@@ -62,61 +62,61 @@ struct input_ressource_t
};
/* */
static
void
DestroySout
(
input_res
source_t
*
p_res
source
)
static
void
DestroySout
(
input_res
ource_t
*
p_re
source
)
{
#ifdef ENABLE_SOUT
if
(
p_res
s
ource
->
p_sout
)
sout_DeleteInstance
(
p_res
s
ource
->
p_sout
);
if
(
p_resource
->
p_sout
)
sout_DeleteInstance
(
p_resource
->
p_sout
);
#endif
p_res
s
ource
->
p_sout
=
NULL
;
p_resource
->
p_sout
=
NULL
;
}
static
sout_instance_t
*
RequestSout
(
input_res
source_t
*
p_res
source
,
static
sout_instance_t
*
RequestSout
(
input_res
ource_t
*
p_re
source
,
sout_instance_t
*
p_sout
,
const
char
*
psz_sout
)
{
#ifdef ENABLE_SOUT
if
(
!
p_sout
&&
!
psz_sout
)
{
if
(
p_res
s
ource
->
p_sout
)
msg_Dbg
(
p_res
s
ource
->
p_sout
,
"destroying useless sout"
);
DestroySout
(
p_res
s
ource
);
if
(
p_resource
->
p_sout
)
msg_Dbg
(
p_resource
->
p_sout
,
"destroying useless sout"
);
DestroySout
(
p_resource
);
return
NULL
;
}
assert
(
p_res
s
ource
->
p_input
);
assert
(
!
p_sout
||
(
!
p_res
s
ource
->
p_sout
&&
!
psz_sout
)
);
assert
(
p_resource
->
p_input
);
assert
(
!
p_sout
||
(
!
p_resource
->
p_sout
&&
!
psz_sout
)
);
/* Check the validity of the sout */
if
(
p_res
s
ource
->
p_sout
&&
strcmp
(
p_res
s
ource
->
p_sout
->
psz_sout
,
psz_sout
)
)
if
(
p_resource
->
p_sout
&&
strcmp
(
p_resource
->
p_sout
->
psz_sout
,
psz_sout
)
)
{
msg_Dbg
(
p_res
s
ource
->
p_input
,
"destroying unusable sout"
);
DestroySout
(
p_res
s
ource
);
msg_Dbg
(
p_resource
->
p_input
,
"destroying unusable sout"
);
DestroySout
(
p_resource
);
}
if
(
psz_sout
)
{
if
(
p_res
s
ource
->
p_sout
)
if
(
p_resource
->
p_sout
)
{
/* Reuse it */
msg_Dbg
(
p_res
s
ource
->
p_input
,
"reusing sout"
);
msg_Dbg
(
p_res
s
ource
->
p_input
,
"you probably want to use gather stream_out"
);
vlc_object_attach
(
p_res
source
->
p_sout
,
p_res
source
->
p_input
);
msg_Dbg
(
p_resource
->
p_input
,
"reusing sout"
);
msg_Dbg
(
p_resource
->
p_input
,
"you probably want to use gather stream_out"
);
vlc_object_attach
(
p_res
ource
->
p_sout
,
p_re
source
->
p_input
);
}
else
{
/* Create a new one */
p_res
source
->
p_sout
=
sout_NewInstance
(
p_res
source
->
p_input
,
psz_sout
);
p_res
ource
->
p_sout
=
sout_NewInstance
(
p_re
source
->
p_input
,
psz_sout
);
}
p_sout
=
p_res
s
ource
->
p_sout
;
p_res
s
ource
->
p_sout
=
NULL
;
p_sout
=
p_resource
->
p_sout
;
p_resource
->
p_sout
=
NULL
;
return
p_sout
;
}
else
{
vlc_object_detach
(
p_sout
);
p_res
s
ource
->
p_sout
=
p_sout
;
p_resource
->
p_sout
=
p_sout
;
return
NULL
;
}
...
...
@@ -126,23 +126,23 @@ static sout_instance_t *RequestSout( input_ressource_t *p_ressource,
}
/* */
static
void
DestroyVout
(
input_res
source_t
*
p_res
source
)
static
void
DestroyVout
(
input_res
ource_t
*
p_re
source
)
{
assert
(
p_res
s
ource
->
i_vout
==
0
);
assert
(
p_resource
->
i_vout
==
0
);
if
(
p_res
s
ource
->
p_vout_free
)
vout_CloseAndRelease
(
p_res
s
ource
->
p_vout_free
);
if
(
p_resource
->
p_vout_free
)
vout_CloseAndRelease
(
p_resource
->
p_vout_free
);
p_res
s
ource
->
p_vout_free
=
NULL
;
p_resource
->
p_vout_free
=
NULL
;
}
static
void
DisplayVoutTitle
(
input_res
source_t
*
p_res
source
,
static
void
DisplayVoutTitle
(
input_res
ource_t
*
p_re
source
,
vout_thread_t
*
p_vout
)
{
assert
(
p_res
s
ource
->
p_input
);
assert
(
p_resource
->
p_input
);
/* TODO display the title only one time for the same input ? */
input_item_t
*
p_item
=
input_GetItem
(
p_res
s
ource
->
p_input
);
input_item_t
*
p_item
=
input_GetItem
(
p_resource
->
p_input
);
char
*
psz_nowplaying
=
input_item_GetNowPlaying
(
p_item
);
if
(
psz_nowplaying
&&
*
psz_nowplaying
)
...
...
@@ -177,51 +177,51 @@ static void DisplayVoutTitle( input_ressource_t *p_ressource,
}
free
(
psz_nowplaying
);
}
static
vout_thread_t
*
RequestVout
(
input_res
source_t
*
p_res
source
,
static
vout_thread_t
*
RequestVout
(
input_res
ource_t
*
p_re
source
,
vout_thread_t
*
p_vout
,
video_format_t
*
p_fmt
,
bool
b_recycle
)
{
if
(
!
p_vout
&&
!
p_fmt
)
{
if
(
p_res
s
ource
->
p_vout_free
)
if
(
p_resource
->
p_vout_free
)
{
msg_Dbg
(
p_res
s
ource
->
p_vout_free
,
"destroying useless vout"
);
vout_CloseAndRelease
(
p_res
s
ource
->
p_vout_free
);
p_res
s
ource
->
p_vout_free
=
NULL
;
msg_Dbg
(
p_resource
->
p_vout_free
,
"destroying useless vout"
);
vout_CloseAndRelease
(
p_resource
->
p_vout_free
);
p_resource
->
p_vout_free
=
NULL
;
}
return
NULL
;
}
assert
(
p_res
s
ource
->
p_input
);
assert
(
p_resource
->
p_input
);
if
(
p_fmt
)
{
/* */
if
(
!
p_vout
&&
p_res
s
ource
->
p_vout_free
)
if
(
!
p_vout
&&
p_resource
->
p_vout_free
)
{
msg_Dbg
(
p_res
s
ource
->
p_input
,
"trying to reuse free vout"
);
p_vout
=
p_res
s
ource
->
p_vout_free
;
msg_Dbg
(
p_resource
->
p_input
,
"trying to reuse free vout"
);
p_vout
=
p_resource
->
p_vout_free
;
p_res
s
ource
->
p_vout_free
=
NULL
;
p_resource
->
p_vout_free
=
NULL
;
}
else
if
(
p_vout
)
{
assert
(
p_vout
!=
p_res
s
ource
->
p_vout_free
);
assert
(
p_vout
!=
p_resource
->
p_vout_free
);
vlc_mutex_lock
(
&
p_res
s
ource
->
lock_vout
);
TAB_REMOVE
(
p_res
source
->
i_vout
,
p_res
source
->
pp_vout
,
p_vout
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_lock
(
&
p_resource
->
lock_vout
);
TAB_REMOVE
(
p_res
ource
->
i_vout
,
p_re
source
->
pp_vout
,
p_vout
);
vlc_mutex_unlock
(
&
p_resource
->
lock_vout
);
}
/* */
p_vout
=
vout_Request
(
p_res
s
ource
->
p_input
,
p_vout
,
p_fmt
);
p_vout
=
vout_Request
(
p_resource
->
p_input
,
p_vout
,
p_fmt
);
if
(
!
p_vout
)
return
NULL
;
DisplayVoutTitle
(
p_res
s
ource
,
p_vout
);
DisplayVoutTitle
(
p_resource
,
p_vout
);
vlc_mutex_lock
(
&
p_res
s
ource
->
lock_vout
);
TAB_APPEND
(
p_res
source
->
i_vout
,
p_res
source
->
pp_vout
,
p_vout
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_lock
(
&
p_resource
->
lock_vout
);
TAB_APPEND
(
p_res
ource
->
i_vout
,
p_re
source
->
pp_vout
,
p_vout
);
vlc_mutex_unlock
(
&
p_resource
->
lock_vout
);
return
p_vout
;
}
...
...
@@ -229,117 +229,117 @@ static vout_thread_t *RequestVout( input_ressource_t *p_ressource,
{
assert
(
p_vout
);
vlc_mutex_lock
(
&
p_res
s
ource
->
lock_vout
);
TAB_REMOVE
(
p_res
source
->
i_vout
,
p_res
source
->
pp_vout
,
p_vout
);
const
int
i_vout_active
=
p_res
s
ource
->
i_vout
;
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_lock
(
&
p_resource
->
lock_vout
);
TAB_REMOVE
(
p_res
ource
->
i_vout
,
p_re
source
->
pp_vout
,
p_vout
);
const
int
i_vout_active
=
p_resource
->
i_vout
;
vlc_mutex_unlock
(
&
p_resource
->
lock_vout
);
if
(
p_res
s
ource
->
p_vout_free
||
i_vout_active
>
0
||
!
b_recycle
)
if
(
p_resource
->
p_vout_free
||
i_vout_active
>
0
||
!
b_recycle
)
{
if
(
b_recycle
)
msg_Dbg
(
p_res
s
ource
->
p_input
,
"detroying vout (already one saved or active)"
);
msg_Dbg
(
p_resource
->
p_input
,
"detroying vout (already one saved or active)"
);
vout_CloseAndRelease
(
p_vout
);
}
else
{
msg_Dbg
(
p_res
s
ource
->
p_input
,
"saving a free vout"
);
msg_Dbg
(
p_resource
->
p_input
,
"saving a free vout"
);
vout_Flush
(
p_vout
,
1
);
spu_Control
(
p_vout
->
p_spu
,
SPU_CHANNEL_CLEAR
,
-
1
);
p_res
s
ource
->
p_vout_free
=
p_vout
;
p_resource
->
p_vout_free
=
p_vout
;
}
return
NULL
;
}
}
static
vout_thread_t
*
HoldVout
(
input_res
source_t
*
p_res
source
)
static
vout_thread_t
*
HoldVout
(
input_res
ource_t
*
p_re
source
)
{
if
(
p_res
s
ource
->
i_vout
<=
0
)
if
(
p_resource
->
i_vout
<=
0
)
return
NULL
;
/* TODO FIXME: p_res
s
ource->pp_vout order is NOT stable */
vlc_mutex_lock
(
&
p_res
s
ource
->
lock_vout
);
/* TODO FIXME: p_resource->pp_vout order is NOT stable */
vlc_mutex_lock
(
&
p_resource
->
lock_vout
);
vout_thread_t
*
p_vout
=
p_res
s
ource
->
pp_vout
[
0
];
vout_thread_t
*
p_vout
=
p_resource
->
pp_vout
[
0
];
vlc_object_hold
(
p_vout
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_unlock
(
&
p_resource
->
lock_vout
);
return
p_vout
;
}
static
void
HoldVouts
(
input_res
source_t
*
p_res
source
,
vout_thread_t
***
ppp_vout
,
int
*
pi_vout
)
static
void
HoldVouts
(
input_res
ource_t
*
p_re
source
,
vout_thread_t
***
ppp_vout
,
int
*
pi_vout
)
{
vout_thread_t
**
pp_vout
;
*
pi_vout
=
0
;
*
ppp_vout
=
NULL
;
vlc_mutex_lock
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_lock
(
&
p_resource
->
lock_vout
);
if
(
p_res
s
ource
->
i_vout
<=
0
)
if
(
p_resource
->
i_vout
<=
0
)
goto
exit
;
pp_vout
=
calloc
(
p_res
s
ource
->
i_vout
,
sizeof
(
*
pp_vout
)
);
pp_vout
=
calloc
(
p_resource
->
i_vout
,
sizeof
(
*
pp_vout
)
);
if
(
!
pp_vout
)
goto
exit
;
*
ppp_vout
=
pp_vout
;
*
pi_vout
=
p_res
s
ource
->
i_vout
;
*
pi_vout
=
p_resource
->
i_vout
;
for
(
int
i
=
0
;
i
<
p_res
s
ource
->
i_vout
;
i
++
)
for
(
int
i
=
0
;
i
<
p_resource
->
i_vout
;
i
++
)
{
pp_vout
[
i
]
=
p_res
s
ource
->
pp_vout
[
i
];
pp_vout
[
i
]
=
p_resource
->
pp_vout
[
i
];
vlc_object_hold
(
pp_vout
[
i
]
);
}
exit:
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_unlock
(
&
p_resource
->
lock_vout
);
}
/* */
static
void
DestroyAout
(
input_res
source_t
*
p_res
source
)
static
void
DestroyAout
(
input_res
ource_t
*
p_re
source
)
{
if
(
p_res
s
ource
->
p_aout
)
vlc_object_release
(
p_res
s
ource
->
p_aout
);
p_res
s
ource
->
p_aout
=
NULL
;
if
(
p_resource
->
p_aout
)
vlc_object_release
(
p_resource
->
p_aout
);
p_resource
->
p_aout
=
NULL
;
}
static
aout_instance_t
*
RequestAout
(
input_res
source_t
*
p_res
source
,
aout_instance_t
*
p_aout
)
static
aout_instance_t
*
RequestAout
(
input_res
ource_t
*
p_re
source
,
aout_instance_t
*
p_aout
)
{
assert
(
p_res
s
ource
->
p_input
);
assert
(
p_resource
->
p_input
);
if
(
p_aout
)
{
msg_Dbg
(
p_res
s
ource
->
p_input
,
"releasing aout"
);
msg_Dbg
(
p_resource
->
p_input
,
"releasing aout"
);
vlc_object_release
(
p_aout
);
return
NULL
;
}
else
{
if
(
!
p_res
s
ource
->
p_aout
)
if
(
!
p_resource
->
p_aout
)
{
msg_Dbg
(
p_res
s
ource
->
p_input
,
"creating aout"
);
p_res
source
->
p_aout
=
aout_New
(
p_res
source
->
p_input
);
msg_Dbg
(
p_resource
->
p_input
,
"creating aout"
);
p_res
ource
->
p_aout
=
aout_New
(
p_re
source
->
p_input
);
}
else
{
msg_Dbg
(
p_res
s
ource
->
p_input
,
"reusing aout"
);
msg_Dbg
(
p_resource
->
p_input
,
"reusing aout"
);
}
if
(
!
p_res
s
ource
->
p_aout
)
if
(
!
p_resource
->
p_aout
)
return
NULL
;
vlc_object_detach
(
p_res
s
ource
->
p_aout
);
vlc_object_attach
(
p_res
source
->
p_aout
,
p_res
source
->
p_input
);
vlc_object_hold
(
p_res
s
ource
->
p_aout
);
return
p_res
s
ource
->
p_aout
;
vlc_object_detach
(
p_resource
->
p_aout
);
vlc_object_attach
(
p_res
ource
->
p_aout
,
p_re
source
->
p_input
);
vlc_object_hold
(
p_resource
->
p_aout
);
return
p_resource
->
p_aout
;
}
}
static
aout_instance_t
*
HoldAout
(
input_res
source_t
*
p_res
source
)
static
aout_instance_t
*
HoldAout
(
input_res
ource_t
*
p_re
source
)
{
if
(
!
p_res
s
ource
->
p_aout
)
if
(
!
p_resource
->
p_aout
)
return
NULL
;
aout_instance_t
*
p_aout
=
p_res
s
ource
->
p_aout
;
aout_instance_t
*
p_aout
=
p_resource
->
p_aout
;
vlc_object_hold
(
p_aout
);
...
...
@@ -347,110 +347,110 @@ static aout_instance_t *HoldAout( input_ressource_t *p_ressource )
}
/* */
input_res
source_t
*
input_res
source_New
(
void
)
input_res
ource_t
*
input_re
source_New
(
void
)
{
input_res
source_t
*
p_ressource
=
calloc
(
1
,
sizeof
(
*
p_res
source
)
);
if
(
!
p_res
s
ource
)
input_res
ource_t
*
p_resource
=
calloc
(
1
,
sizeof
(
*
p_re
source
)
);
if
(
!
p_resource
)
return
NULL
;
vlc_mutex_init
(
&
p_res
s
ource
->
lock
);
vlc_mutex_init
(
&
p_res
s
ource
->
lock_vout
);
return
p_res
s
ource
;
vlc_mutex_init
(
&
p_resource
->
lock
);
vlc_mutex_init
(
&
p_resource
->
lock_vout
);
return
p_resource
;
}
void
input_res
source_Delete
(
input_ressource_t
*
p_res
source
)
void
input_res
ource_Delete
(
input_resource_t
*
p_re
source
)
{
DestroySout
(
p_res
s
ource
);
DestroyVout
(
p_res
s
ource
);
DestroyAout
(
p_res
s
ource
);
DestroySout
(
p_resource
);
DestroyVout
(
p_resource
);
DestroyAout
(
p_resource
);
vlc_mutex_destroy
(
&
p_res
s
ource
->
lock_vout
);
vlc_mutex_destroy
(
&
p_res
s
ource
->
lock
);
free
(
p_res
s
ource
);
vlc_mutex_destroy
(
&
p_resource
->
lock_vout
);
vlc_mutex_destroy
(
&
p_resource
->
lock
);
free
(
p_resource
);
}
void
input_res
source_SetInput
(
input_ressource_t
*
p_res
source
,
input_thread_t
*
p_input
)
void
input_res
ource_SetInput
(
input_resource_t
*
p_re
source
,
input_thread_t
*
p_input
)
{
vlc_mutex_lock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_lock
(
&
p_resource
->
lock
);
if
(
p_res
s
ource
->
p_input
&&
!
p_input
)
if
(
p_resource
->
p_input
&&
!
p_input
)
{
if
(
p_res
s
ource
->
p_aout
)
vlc_object_detach
(
p_res
s
ource
->
p_aout
);
if
(
p_resource
->
p_aout
)
vlc_object_detach
(
p_resource
->
p_aout
);
assert
(
p_res
s
ource
->
i_vout
==
0
);
if
(
p_res
s
ource
->
p_vout_free
)
vlc_object_detach
(
p_res
s
ource
->
p_vout_free
);
assert
(
p_resource
->
i_vout
==
0
);
if
(
p_resource
->
p_vout_free
)
vlc_object_detach
(
p_resource
->
p_vout_free
);
if
(
p_res
s
ource
->
p_sout
)
vlc_object_detach
(
p_res
s
ource
->
p_sout
);
if
(
p_resource
->
p_sout
)
vlc_object_detach
(
p_resource
->
p_sout
);
}
/* */
p_res
s
ource
->
p_input
=
p_input
;
p_resource
->
p_input
=
p_input
;
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_unlock
(
&
p_resource
->
lock
);
}
vout_thread_t
*
input_res
source_RequestVout
(
input_ressource_t
*
p_res
source
,
vout_thread_t
*
input_res
ource_RequestVout
(
input_resource_t
*
p_re
source
,
vout_thread_t
*
p_vout
,
video_format_t
*
p_fmt
,
bool
b_recycle
)
{
vlc_mutex_lock
(
&
p_res
s
ource
->
lock
);
vout_thread_t
*
p_ret
=
RequestVout
(
p_res
s
ource
,
p_vout
,
p_fmt
,
b_recycle
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_lock
(
&
p_resource
->
lock
);
vout_thread_t
*
p_ret
=
RequestVout
(
p_resource
,
p_vout
,
p_fmt
,
b_recycle
);
vlc_mutex_unlock
(
&
p_resource
->
lock
);
return
p_ret
;
}
vout_thread_t
*
input_res
source_HoldVout
(
input_ressource_t
*
p_res
source
)
vout_thread_t
*
input_res
ource_HoldVout
(
input_resource_t
*
p_re
source
)
{
return
HoldVout
(
p_res
s
ource
);
return
HoldVout
(
p_resource
);
}
void
input_res
source_HoldVouts
(
input_ressource_t
*
p_res
source
,
vout_thread_t
***
ppp_vout
,
int
*
pi_vout
)
void
input_res
ource_HoldVouts
(
input_resource_t
*
p_re
source
,
vout_thread_t
***
ppp_vout
,
int
*
pi_vout
)
{
HoldVouts
(
p_res
s
ource
,
ppp_vout
,
pi_vout
);
HoldVouts
(
p_resource
,
ppp_vout
,
pi_vout
);
}
void
input_res
source_TerminateVout
(
input_ressource_t
*
p_res
source
)
void
input_res
ource_TerminateVout
(
input_resource_t
*
p_re
source
)
{
input_res
source_RequestVout
(
p_res
source
,
NULL
,
NULL
,
false
);
input_res
ource_RequestVout
(
p_re
source
,
NULL
,
NULL
,
false
);
}
bool
input_res
source_HasVout
(
input_ressource_t
*
p_res
source
)
bool
input_res
ource_HasVout
(
input_resource_t
*
p_re
source
)
{
vlc_mutex_lock
(
&
p_res
s
ource
->
lock
);
assert
(
!
p_res
s
ource
->
p_input
);
const
bool
b_vout
=
p_res
s
ource
->
p_vout_free
!=
NULL
;
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_lock
(
&
p_resource
->
lock
);
assert
(
!
p_resource
->
p_input
);
const
bool
b_vout
=
p_resource
->
p_vout_free
!=
NULL
;
vlc_mutex_unlock
(
&
p_resource
->
lock
);
return
b_vout
;
}
/* */
aout_instance_t
*
input_res
source_RequestAout
(
input_ressource_t
*
p_res
source
,
aout_instance_t
*
p_aout
)
aout_instance_t
*
input_res
ource_RequestAout
(
input_resource_t
*
p_re
source
,
aout_instance_t
*
p_aout
)
{
vlc_mutex_lock
(
&
p_res
s
ource
->
lock
);
aout_instance_t
*
p_ret
=
RequestAout
(
p_res
s
ource
,
p_aout
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_lock
(
&
p_resource
->
lock
);
aout_instance_t
*
p_ret
=
RequestAout
(
p_resource
,
p_aout
);
vlc_mutex_unlock
(
&
p_resource
->
lock
);
return
p_ret
;
}
aout_instance_t
*
input_res
source_HoldAout
(
input_ressource_t
*
p_res
source
)
aout_instance_t
*
input_res
ource_HoldAout
(
input_resource_t
*
p_re
source
)
{
vlc_mutex_lock
(
&
p_res
s
ource
->
lock
);
aout_instance_t
*
p_ret
=
HoldAout
(
p_res
s
ource
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_lock
(
&
p_resource
->
lock
);
aout_instance_t
*
p_ret
=
HoldAout
(
p_resource
);
vlc_mutex_unlock
(
&
p_resource
->
lock
);
return
p_ret
;
}
/* */
sout_instance_t
*
input_res
source_RequestSout
(
input_ressource_t
*
p_res
source
,
sout_instance_t
*
p_sout
,
const
char
*
psz_sout
)
sout_instance_t
*
input_res
ource_RequestSout
(
input_resource_t
*
p_re
source
,
sout_instance_t
*
p_sout
,
const
char
*
psz_sout
)
{
vlc_mutex_lock
(
&
p_res
s
ource
->
lock
);
sout_instance_t
*
p_ret
=
RequestSout
(
p_res
s
ource
,
p_sout
,
psz_sout
);
vlc_mutex_unlock
(
&
p_res
s
ource
->
lock
);
vlc_mutex_lock
(
&
p_resource
->
lock
);
sout_instance_t
*
p_ret
=
RequestSout
(
p_resource
,
p_sout
,
psz_sout
);
vlc_mutex_unlock
(
&
p_resource
->
lock
);
return
p_ret
;
}
void
input_res
source_TerminateSout
(
input_ressource_t
*
p_res
source
)
void
input_res
ource_TerminateSout
(
input_resource_t
*
p_re
source
)
{
input_res
source_RequestSout
(
p_res
source
,
NULL
,
NULL
);
input_res
ource_RequestSout
(
p_re
source
,
NULL
,
NULL
);
}
src/input/res
s
ource.h
→
src/input/resource.h
View file @
c5746ee2
/*****************************************************************************
* res
s
ource.h
* resource.h
*****************************************************************************
* Copyright (C) 2008 Laurent Aimar
* $Id$
...
...
@@ -31,50 +31,50 @@
#include <vlc_common.h>
/**
* This function creates an empty input_res
s
ource_t.
* This function creates an empty input_resource_t.
*/
input_res
source_t
*
input_res
source_New
(
void
);
input_res
ource_t
*
input_re
source_New
(
void
);
/**
* This function set the associated input.
*/
void
input_res
source_SetInput
(
input_res
source_t
*
,
input_thread_t
*
);
void
input_res
ource_SetInput
(
input_re
source_t
*
,
input_thread_t
*
);
/**
* This function handles sout request.
*/
sout_instance_t
*
input_res
source_RequestSout
(
input_res
source_t
*
,
sout_instance_t
*
,
const
char
*
psz_sout
);
sout_instance_t
*
input_res
ource_RequestSout
(
input_re
source_t
*
,
sout_instance_t
*
,
const
char
*
psz_sout
);
/**
* This function handles aout request.
*/
aout_instance_t
*
input_res
source_RequestAout
(
input_res
source_t
*
,
aout_instance_t
*
);
aout_instance_t
*
input_res
ource_RequestAout
(
input_re
source_t
*
,
aout_instance_t
*
);
/**
* This function return the current aout if any.
*
* You must call vlc_object_release on the value returned (if non NULL).
*/
aout_instance_t
*
input_res
source_HoldAout
(
input_ressource_t
*
p_res
source
);
aout_instance_t
*
input_res
ource_HoldAout
(
input_resource_t
*
p_re
source
);
/**
* This function handles vout request.
*/
vout_thread_t
*
input_res
source_RequestVout
(
input_res
source_t
*
,
vout_thread_t
*
,
video_format_t
*
,
bool
b_recycle
);
vout_thread_t
*
input_res
ource_RequestVout
(
input_re
source_t
*
,
vout_thread_t
*
,
video_format_t
*
,
bool
b_recycle
);
/**
* This function return one of the current vout if any.
*
* You must call vlc_object_release on the value returned (if non NULL).
*/
vout_thread_t
*
input_res
source_HoldVout
(
input_res
source_t
*
);
vout_thread_t
*
input_res
ource_HoldVout
(
input_re
source_t
*
);
/**
* This function return all current vouts if any.
*
* You must call vlc_object_release on all values returned (if non NULL).
*/
void
input_res
source_HoldVouts
(
input_res
source_t
*
,
vout_thread_t
***
,
int
*
);
void
input_res
ource_HoldVouts
(
input_re
source_t
*
,
vout_thread_t
***
,
int
*
);
#endif
src/input/vlm.c
View file @
c5746ee2
...
...
@@ -759,7 +759,7 @@ static vlm_media_instance_sys_t *vlm_MediaInstanceNew( vlm_t *p_vlm, const char
p_instance
->
i_index
=
0
;
p_instance
->
b_sout_keep
=
false
;
p_instance
->
p_input
=
NULL
;
p_instance
->
p_input_res
s
ource
=
NULL
;
p_instance
->
p_input_resource
=
NULL
;
return
p_instance
;
}
...
...
@@ -768,18 +768,18 @@ static void vlm_MediaInstanceDelete( vlm_media_instance_sys_t *p_instance )
input_thread_t
*
p_input
=
p_instance
->
p_input
;
if
(
p_input
)
{
input_res
source_t
*
p_res
source
;
input_res
ource_t
*
p_re
source
;
input_StopThread
(
p_input
);
vlc_thread_join
(
p_input
);
p_res
s
ource
=
input_DetachRessource
(
p_input
);
input_res
source_Delete
(
p_res
source
);
p_resource
=
input_DetachRessource
(
p_input
);
input_res
ource_Delete
(
p_re
source
);
vlc_object_release
(
p_input
);
}
if
(
p_instance
->
p_input_res
s
ource
)
input_res
source_Delete
(
p_instance
->
p_input_res
source
);
if
(
p_instance
->
p_input_resource
)
input_res
ource_Delete
(
p_instance
->
p_input_re
source
);
vlc_gc_decref
(
p_instance
->
p_item
);
free
(
p_instance
->
psz_name
);
...
...
@@ -854,13 +854,13 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
input_StopThread
(
p_input
);
vlc_thread_join
(
p_input
);
p_instance
->
p_input_res
s
ource
=
input_DetachRessource
(
p_input
);
p_instance
->
p_input_resource
=
input_DetachRessource
(
p_input
);
vlc_object_release
(
p_input
);
if
(
!
p_instance
->
b_sout_keep
)
input_res
source_TerminateSout
(
p_instance
->
p_input_res
source
);
input_res
source_TerminateVout
(
p_instance
->
p_input_res
source
);
input_res
ource_TerminateSout
(
p_instance
->
p_input_re
source
);
input_res
ource_TerminateVout
(
p_instance
->
p_input_re
source
);
}
/* Start new one */
...
...
@@ -870,8 +870,8 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
if
(
asprintf
(
&
psz_log
,
_
(
"Media: %s"
),
p_media
->
cfg
.
psz_name
)
!=
-
1
)
{
p_instance
->
p_input
=
input_CreateThreadExtended
(
p_vlm
,
p_instance
->
p_item
,
psz_log
,
p_instance
->
p_input_res
s
ource
);
p_instance
->
p_input_res
s
ource
=
NULL
;
psz_log
,
p_instance
->
p_input_resource
);
p_instance
->
p_input_resource
=
NULL
;
if
(
!
p_instance
->
p_input
)
{
...
...
src/input/vlm_internal.h
View file @
c5746ee2
...
...
@@ -43,7 +43,7 @@ typedef struct
input_item_t
*
p_item
;
input_thread_t
*
p_input
;
input_res
source_t
*
p_input_res
source
;
input_res
ource_t
*
p_input_re
source
;
}
vlm_media_instance_sys_t
;
...
...
src/misc/messages.c
View file @
c5746ee2
...
...
@@ -160,7 +160,7 @@ void __msg_DisableObjectPrinting (vlc_object_t *p_this, char * psz_object)
* Destroy the message queues
*
* This functions prints all messages remaining in the queues,
* then frees all the allocated res
s
ources
* then frees all the allocated resources
* No other messages interface functions should be called after this one.
*/
void
msg_Destroy
(
libvlc_int_t
*
p_libvlc
)
...
...
src/playlist/engine.c
View file @
c5746ee2
...
...
@@ -176,7 +176,7 @@ static void playlist_Destructor( vlc_object_t * p_this )
playlist_private_t
*
p_sys
=
pl_priv
(
p_playlist
);
assert
(
!
p_sys
->
p_input
);
assert
(
!
p_sys
->
p_input_res
s
ource
);
assert
(
!
p_sys
->
p_input_resource
);
assert
(
!
p_sys
->
p_preparser
);
assert
(
!
p_sys
->
p_fetcher
);
...
...
src/playlist/playlist_internal.h
View file @
c5746ee2
...
...
@@ -59,7 +59,7 @@ typedef struct playlist_private_t
int
i_sds
;
/**< Number of service discovery modules */
input_thread_t
*
p_input
;
/**< the input thread associated
* with the current item */
input_res
source_t
*
p_input_ressource
;
/**< input res
sources */
input_res
ource_t
*
p_input_resource
;
/**< input re
sources */
struct
{
/* Current status. These fields are readonly, only the playlist
* main loop can touch it*/
...
...
src/playlist/thread.c
View file @
c5746ee2
...
...
@@ -102,10 +102,10 @@ void playlist_Deactivate( playlist_t *p_playlist )
if
(
p_fetcher
)
playlist_fetcher_Delete
(
p_fetcher
);
/* release input res
s
ources */
if
(
p_sys
->
p_input_res
s
ource
)
input_res
source_Delete
(
p_sys
->
p_input_res
source
);
p_sys
->
p_input_res
s
ource
=
NULL
;
/* release input resources */
if
(
p_sys
->
p_input_resource
)
input_res
ource_Delete
(
p_sys
->
p_input_re
source
);
p_sys
->
p_input_resource
=
NULL
;
/* */
playlist_MLDump
(
p_playlist
);
...
...
@@ -252,7 +252,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
assert
(
p_sys
->
p_input
==
NULL
);
input_thread_t
*
p_input_thread
=
input_CreateThreadExtended
(
p_playlist
,
p_input
,
NULL
,
p_sys
->
p_input_res
s
ource
);
input_CreateThreadExtended
(
p_playlist
,
p_input
,
NULL
,
p_sys
->
p_input_resource
);
if
(
p_input_thread
)
{
...
...
@@ -261,7 +261,7 @@ static int PlayItem( playlist_t *p_playlist, playlist_item_t *p_item )
var_AddCallback
(
p_input_thread
,
"intf-event"
,
InputEvent
,
p_playlist
);
}
p_sys
->
p_input_res
s
ource
=
NULL
;
p_sys
->
p_input_resource
=
NULL
;
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
if
(
psz_uri
&&
(
!
strncmp
(
psz_uri
,
"directory:"
,
10
)
||
...
...
@@ -481,16 +481,16 @@ static int LoopInput( playlist_t *p_playlist )
{
PL_DEBUG
(
"dead input"
);
assert
(
p_sys
->
p_input_res
s
ource
==
NULL
);
assert
(
p_sys
->
p_input_resource
==
NULL
);
p_sys
->
p_input_res
s
ource
=
input_DetachRessource
(
p_input
);
p_sys
->
p_input_resource
=
input_DetachRessource
(
p_input
);
PL_UNLOCK
;
/* We can unlock as we return VLC_EGENERIC (no event will be lost) */
/* input_res
s
ource_t must be manipulated without playlist lock */
/* input_resource_t must be manipulated without playlist lock */
if
(
!
var_CreateGetBool
(
p_input
,
"sout-keep"
)
)
input_res
source_TerminateSout
(
p_sys
->
p_input_res
source
);
input_res
ource_TerminateSout
(
p_sys
->
p_input_re
source
);
/* The DelCallback must be issued without playlist lock */
var_DelCallback
(
p_input
,
"intf-event"
,
InputEvent
,
p_playlist
);
...
...
@@ -537,15 +537,15 @@ static void LoopRequest( playlist_t *p_playlist )
{
p_sys
->
status
.
i_status
=
PLAYLIST_STOPPED
;
if
(
p_sys
->
p_input_res
s
ource
&&
input_res
source_HasVout
(
p_sys
->
p_input_res
source
)
)
if
(
p_sys
->
p_input_resource
&&
input_res
ource_HasVout
(
p_sys
->
p_input_re
source
)
)
{
/* XXX We can unlock if we don't issue the wait as we will be
* call again without anything else done between the calls */
PL_UNLOCK
;
/* input_res
s
ource_t must be manipulated without playlist lock */
input_res
source_TerminateVout
(
p_sys
->
p_input_res
source
);
/* input_resource_t must be manipulated without playlist lock */
input_res
ource_TerminateVout
(
p_sys
->
p_input_re
source
);
PL_LOCK
;
}
...
...
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