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
1fc13bde
Commit
1fc13bde
authored
Aug 24, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Template for profile parser
parent
dc67fdeb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
131 additions
and
47 deletions
+131
-47
configure.ac
configure.ac
+1
-0
include/vlc_common.h
include/vlc_common.h
+1
-0
include/vlc_streaming.h
include/vlc_streaming.h
+9
-0
modules/misc/Modules.am
modules/misc/Modules.am
+1
-0
modules/misc/profile_parser.c
modules/misc/profile_parser.c
+104
-0
src/stream_output/profiles.c
src/stream_output/profiles.c
+15
-47
No files found.
configure.ac
View file @
1fc13bde
...
...
@@ -1459,6 +1459,7 @@ then
VLC_ADD_PLUGINS([stream_out_dummy stream_out_standard stream_out_es stream_out_rtp stream_out_description vod_rtsp])
VLC_ADD_PLUGINS([stream_out_duplicate stream_out_gather stream_out_display stream_out_transcode stream_out_bridge stream_out_mosaic_bridge])
# VLC_ADD_PLUGINS([stream_out_transrate])
VLC_ADD_PLUGINS([profile_parser])
AC_DEFINE(ENABLE_SOUT, 1, Define if you want the stream output support)
fi
...
...
include/vlc_common.h
View file @
1fc13bde
...
...
@@ -343,6 +343,7 @@ typedef struct sout_chain_t sout_chain_t;
typedef
struct
streaming_profile_t
streaming_profile_t
;
typedef
struct
sout_module_t
sout_module_t
;
typedef
struct
sout_gui_descr_t
sout_gui_descr_t
;
typedef
struct
profile_parser_t
profile_parser_t
;
/* Decoders */
typedef
struct
decoder_t
decoder_t
;
...
...
include/vlc_streaming.h
View file @
1fc13bde
...
...
@@ -191,6 +191,15 @@ static inline sout_chain_t *streaming_ChainNew()
return
p_chain
;
}
struct
profile_parser_t
{
char
*
psz_profile
;
streaming_profile_t
*
p_profile
;
};
//VLC_XEXPORT( char *, streaming_ChainToPsz, (sout_chain_t * ) );
#endif
modules/misc/Modules.am
View file @
1fc13bde
...
...
@@ -13,3 +13,4 @@ SOURCES_svg = svg.c
SOURCES_msn = msn.c
SOURCES_growl = growl.c
SOURCES_notify = notify.c
SOURCES_profile_parser = profile_parser.c
modules/misc/profile_parser.c
0 → 100644
View file @
1fc13bde
/*****************************************************************************
* profile_parser.c : VLC Streaming Profile parser
*****************************************************************************
* Copyright (C) 2003-2006 the VideoLAN team
* $Id: rtsp.c 16204 2006-08-03 16:58:10Z zorglub $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@videolan.org>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc_streaming.h>
#include "vlc_xml.h"
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
);
vlc_module_begin
();
set_capability
(
"profile parser"
,
1
);
set_callbacks
(
Open
,
NULL
);
vlc_module_end
();
static
int
Open
(
vlc_object_t
*
p_this
)
{
profile_parser_t
*
p_parser
=
(
profile_parser_t
*
)
p_this
->
p_private
;
stream_t
*
p_stream
=
stream_UrlNew
(
p_this
,
p_parser
->
psz_profile
);
xml_t
*
p_xml
;
xml_reader_t
*
p_reader
;
int
i_ret
;
char
*
psz_elname
;
/* Open the profile and get a XML reader from it */
if
(
!
p_stream
)
{
msg_Err
(
p_this
,
"failed to parse profile %s"
,
p_parser
->
psz_profile
);
return
VLC_EGENERIC
;
}
p_xml
=
xml_Create
(
p_this
);
if
(
!
p_xml
)
return
VLC_EGENERIC
;
p_reader
=
xml_ReaderCreate
(
p_xml
,
p_stream
);
if
(
xml_ReaderRead
(
p_reader
)
!=
1
||
xml_ReaderNodeType
(
p_reader
)
!=
XML_READER_STARTELEM
)
{
msg_Err
(
p_this
,
"invalid file (invalid root)"
);
return
VLC_EGENERIC
;
}
/* Here goes the real parsing */
while
(
(
i_ret
=
xml_ReaderRead
(
p_reader
)
)
==
1
)
{
int
i_type
=
xml_ReaderNodeType
(
p_reader
);
switch
(
i_type
)
{
case
-
1
:
/* ERROR : Bail out */
return
-
1
;
case
XML_READER_STARTELEM
:
FREE
(
psz_elname
);
psz_elname
=
xml_ReaderName
(
p_reader
);
if
(
!
psz_elname
)
return
VLC_EGENERIC
;
printf
(
"<%s"
,
psz_elname
);
break
;
case
XML_READER_TEXT
:
break
;
case
XML_READER_ENDELEM
:
FREE
(
psz_elname
);
psz_elname
=
xml_ReaderName
(
p_reader
);
if
(
!
psz_elname
)
return
VLC_EGENERIC
;
printf
(
">"
);
break
;
}
}
if
(
i_ret
!=
0
)
{
msg_Err
(
p_this
,
"parse error"
);
return
VLC_EGENERIC
;
}
if
(
p_reader
)
xml_ReaderDelete
(
p_xml
,
p_reader
);
if
(
p_xml
)
xml_Delete
(
p_xml
);
return
VLC_SUCCESS
;
}
src/stream_output/profiles.c
View file @
1fc13bde
...
...
@@ -390,55 +390,23 @@ void streaming_ProfilesList( vlc_object_t *p_this, int *pi_profiles,
}
//////////// DEPRECATED
#if 0
vlc_bool_t streaming_ChainIsGuiSupported( sout_chain_t *p_chain,
vlc_bool_t b_root )
/** Parse a profile */
int
streaming_ProfileParse
(
vlc_object_t
*
p_this
,
streaming_profile_t
*
p_profile
,
const
char
*
psz_profile
)
{
/* First is transcode, std/rtp or duplicate.
* If transcode, then std/rtp or duplicate
* If duplicate, each subchain is std/rtp only */
int j;
if( p_chain->i_modules == 0 || p_chain->i_modules > 2 ) return VLC_FALSE;
DECMALLOC_ERR
(
p_parser
,
profile_parser_t
);
module_t
*
p_module
;
assert
(
p_profile
);
assert
(
psz_profile
);
if( p_chain->pp_modules[0]->i_type == SOUT_MOD_TRANSCODE && b_root )
{
if( p_chain->pp_modules[1]->i_type == SOUT_MOD_DUPLICATE )
{
sout_duplicate_t *p_dup = p_chain->pp_modules[1]->typed.p_duplicate;
if( p_dup->i_children == 0 ) return VLC_FALSE;
for( j = 0 ; j< p_dup->i_children ; j++ )
{
if( !streaming_ChainIsGuiSupported( p_dup->pp_children[j],
VLC_FALSE))
return VLC_FALSE;
}
return VLC_TRUE;
}
}
if( p_chain->pp_modules[0]->i_type == SOUT_MOD_DUPLICATE && b_root )
{
sout_duplicate_t *p_dup = p_chain->pp_modules[0]->typed.p_duplicate;
if( p_dup->i_children == 0 ) return VLC_FALSE;
for( j = 0 ; j< p_dup->i_children ; j++ )
{
if( !streaming_ChainIsSupported( p_dup->pp_children[j], VLC_FALSE))
return VLC_FALSE;
}
return VLC_TRUE;
}
// Now check for supported simple chain
if( p_chain->i_modules == 1 || b_root )
{
return p_chain->pp_modules[0]->i_type == SOUT_MOD_RTP ||
p_chain->pp_modules[0]->i_type == SOUT_MOD_STD;
}
else if( b_root )
p_parser
->
psz_profile
=
strdup
(
psz_profile
);
p_parser
->
p_profile
=
p_profile
;
p_this
->
p_private
=
(
void
*
)
p_parser
;
/* And call the module ! All work is done now */
p_module
=
module_Need
(
p_this
,
"profile parser"
,
""
,
VLC_TRUE
);
if
(
!
p_module
)
{
return p_chain->pp_modules[0]->i_type == SOUT_MOD_TRANSCODE &&
(p_chain->pp_modules[1]->i_type == SOUT_MOD_RTP ||
p_chain->pp_modules[1]->i_type == SOUT_MOD_STD );
msg_Warn
(
p_this
,
"parsing profile failed"
);
}
return VLC_FALSE;
}
#endif
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