mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-04 09:11:33 +02:00
stream_filter: add ADF stream filter (Fixes #17501)
This commit is contained in:
parent
e9574d8bd4
commit
21bb83f3ae
1
NEWS
1
NEWS
@ -115,6 +115,7 @@ Demuxers:
|
||||
* Fix Quicktime Mp4 inside MKV and unpacketized VC1
|
||||
|
||||
Stream filter:
|
||||
* Added ADF stream filter
|
||||
* Added ARIB STD-B25 TS streams decoder
|
||||
* Added stream prebuffering plugin
|
||||
* Removed HTTP Live streaming stream filter
|
||||
|
@ -24,6 +24,7 @@ $Id$
|
||||
* adaptive: Unified adaptive streaming module (DASH/HLS)
|
||||
* addonsfsstorage: Local storage extensions repository
|
||||
* addonsvorepository: Videolan extensions repository
|
||||
* adf: ADF stream_filter module
|
||||
* adjust: Contrast/Hue/saturation/Brightness adjust module
|
||||
* adpcm: ADPCM audio decoder
|
||||
* adummy: dummy audio output
|
||||
|
@ -49,3 +49,6 @@ libaccesstweaks_plugin_la_CFLAGS = $(AM_CFLAGS)
|
||||
libaccesstweaks_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(stream_filterdir)'
|
||||
stream_filter_LTLIBRARIES += $(LTLIBaccesstweaks)
|
||||
EXTRA_LTLIBRARIES += libaccesstweaks_plugin.la
|
||||
|
||||
libadf_plugin_la_SOURCES = stream_filter/adf.c
|
||||
stream_filter_LTLIBRARIES += libadf_plugin.la
|
||||
|
85
modules/stream_filter/adf.c
Normal file
85
modules/stream_filter/adf.c
Normal file
@ -0,0 +1,85 @@
|
||||
/*****************************************************************************
|
||||
* adf.c ADF stream filter
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2016 VideoLAN Authors
|
||||
*
|
||||
* Author: Tristan Matthews <tmatth@videolan.org>
|
||||
* Based on record.c by: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser 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.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Preamble
|
||||
*****************************************************************************/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <vlc_common.h>
|
||||
#include <vlc_plugin.h>
|
||||
#include <vlc_stream.h>
|
||||
|
||||
static int Open( vlc_object_t * );
|
||||
|
||||
vlc_module_begin()
|
||||
set_shortname( "adf" )
|
||||
set_category( CAT_INPUT )
|
||||
set_subcategory( SUBCAT_INPUT_STREAM_FILTER )
|
||||
set_capability( "stream_filter", 30 )
|
||||
set_description( N_( "ADF stream filter" ) )
|
||||
set_callbacks( Open, NULL )
|
||||
vlc_module_end()
|
||||
|
||||
static int Control( stream_t *p_stream, int i_query, va_list args )
|
||||
{
|
||||
return vlc_stream_vaControl( p_stream->p_source, i_query, args );
|
||||
}
|
||||
|
||||
static ssize_t Read( stream_t *s, void *buffer, size_t i_read )
|
||||
{
|
||||
const ssize_t i_ret = vlc_stream_Read( s->p_source, buffer, i_read );
|
||||
if( i_ret < 1 || !buffer ) return i_ret;
|
||||
|
||||
uint8_t *p_buffer = buffer;
|
||||
static const uint8_t ADF_XOR_MASK = 34;
|
||||
for( ssize_t i = 0; i < i_ret; ++i )
|
||||
p_buffer[i] ^= ADF_XOR_MASK;
|
||||
return i_ret;
|
||||
}
|
||||
|
||||
static int Seek( stream_t *s, uint64_t offset )
|
||||
{
|
||||
return vlc_stream_Seek( s->p_source, offset );
|
||||
}
|
||||
|
||||
static int Open( vlc_object_t *p_object )
|
||||
{
|
||||
stream_t *p_stream = (stream_t *)p_object;
|
||||
|
||||
const uint8_t *peek;
|
||||
if( vlc_stream_Peek( p_stream->p_source, &peek, 3 ) < 3 )
|
||||
return VLC_EGENERIC;
|
||||
|
||||
/* Probe for XOR'd ID3 tag. */
|
||||
if( memcmp( peek, "\x6B\x66\x11", 3 ) )
|
||||
return VLC_EGENERIC;
|
||||
|
||||
p_stream->pf_read = Read;
|
||||
p_stream->pf_seek = Seek;
|
||||
p_stream->pf_control = Control;
|
||||
|
||||
return VLC_SUCCESS;
|
||||
}
|
@ -1029,6 +1029,7 @@ modules/services_discovery/udev.c
|
||||
modules/services_discovery/upnp.cpp
|
||||
modules/services_discovery/windrive.c
|
||||
modules/services_discovery/xcb_apps.c
|
||||
modules/stream_filter/adf.c
|
||||
modules/stream_filter/aribcam.c
|
||||
modules/stream_filter/cache_block.c
|
||||
modules/stream_filter/cache_read.c
|
||||
|
Loading…
Reference in New Issue
Block a user