X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fdshow%2Fdshow.cpp;h=cfaacc1ad5bcbec63f57f28422d4d57bc701b809;hb=e541f7f3aa33c65ad4e27d986251ce0eafdd96b2;hp=40458eb5a7ed7e718c0584449f32b9bf44b3ad3f;hpb=f94a2f9c4a4c7979d9695bb240686c73b6cf7e00;p=vlc diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp index 40458eb5a7..cfaacc1ad5 100644 --- a/modules/access/dshow/dshow.cpp +++ b/modules/access/dshow/dshow.cpp @@ -30,7 +30,11 @@ # include "config.h" #endif -#include +#define __STDC_FORMAT_MACROS 1 +#include + +#include +#include #include #include #include @@ -73,19 +77,19 @@ static void ConfigTuner( vlc_object_t *, ICaptureGraphBuilder2 *, /***************************************************************************** * Module descriptor *****************************************************************************/ -static const char *ppsz_vdev[] = { "", "none" }; -static const char *ppsz_vdev_text[] = { N_("Default"), N_("None") }; -static const char *ppsz_adev[] = { "", "none" }; -static const char *ppsz_adev_text[] = { N_("Default"), N_("None") }; -static int pi_tuner_input[] = { 0, 1, 2 }; -static const char *ppsz_tuner_input_text[] = +static const char *const ppsz_vdev[] = { "", "none" }; +static const char *const ppsz_vdev_text[] = { N_("Default"), N_("None") }; +static const char *const ppsz_adev[] = { "", "none" }; +static const char *const ppsz_adev_text[] = { N_("Default"), N_("None") }; +static const int pi_tuner_input[] = { 0, 1, 2 }; +static const char *const ppsz_tuner_input_text[] = {N_("Default"), N_("Cable"), N_("Antenna")}; static const int pi_amtuner_mode[] = { AMTUNER_MODE_DEFAULT, AMTUNER_MODE_TV, AMTUNER_MODE_FM_RADIO, AMTUNER_MODE_AM_RADIO, AMTUNER_MODE_DSS }; -static const char *ppsz_amtuner_mode_text[] = { N_("Default"), +static const char *const ppsz_amtuner_mode_text[] = { N_("Default"), N_("TV"), N_("FM radio"), N_("AM radio"), @@ -166,8 +170,8 @@ static int DemuxOpen ( vlc_object_t * ); static void DemuxClose ( vlc_object_t * ); vlc_module_begin(); - set_shortname( _("DirectShow") ); - set_description( _("DirectShow input") ); + set_shortname( N_("DirectShow") ); + set_description( N_("DirectShow input") ); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_ACCESS ); add_integer( "dshow-caching", (mtime_t)(0.2*CLOCK_FREQ) / 1000, NULL, @@ -228,7 +232,7 @@ vlc_module_begin(); set_callbacks( DemuxOpen, DemuxClose ); add_submodule(); - set_description( _("DirectShow input") ); + set_description( N_("DirectShow input") ); set_capability( "access", 0 ); set_callbacks( AccessOpen, AccessClose ); @@ -415,7 +419,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys, p_sys->p_capture_graph_builder2 = NULL; p_sys->p_control = NULL; - vlc_mutex_init( p_this, &p_sys->lock ); + vlc_mutex_init( &p_sys->lock ); vlc_cond_init( p_this, &p_sys->wait ); /* Build directshow graph */ @@ -653,11 +657,13 @@ static int AccessOpen( vlc_object_t *p_this ) p_stream->i_fourcc == VLC_FOURCC('d','v','s','d') || p_stream->i_fourcc == VLC_FOURCC('d','v','h','d') ) { + free( p_access->psz_demux ); p_access->psz_demux = strdup( "rawdv" ); } else if( p_stream->i_fourcc == VLC_FOURCC('m','p','2','v') ) { - p_access->psz_demux = "mpgv"; + free( p_access->psz_demux ); + p_access->psz_demux = strdup( "mpgv" ); } } @@ -1641,7 +1647,7 @@ static block_t *ReadCompressed( access_t *p_access ) } sample.p_sample->GetPointer( &p_data ); - p_access->p_libvlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size ); + vlc_memcpy( p_block->p_buffer, p_data, i_data_size ); sample.p_sample->Release(); /* The caller got what he wanted */ @@ -1725,12 +1731,12 @@ static int Demux( demux_t *p_demux ) i_pts /= 10; /* Dshow works with 100 nano-seconds resolution */ #if 0 - msg_Dbg( p_demux, "Read() stream: %i, size: %i, PTS: "I64Fd, + msg_Dbg( p_demux, "Read() stream: %i, size: %i, PTS: %"PRId64, i_stream, i_data_size, i_pts ); #endif p_block = block_New( p_demux, i_data_size ); - p_demux->p_libvlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size ); + vlc_memcpy( p_block->p_buffer, p_data, i_data_size ); p_block->i_pts = p_block->i_dts = i_pts; sample.p_sample->Release();