Changeset aa407ea9ca0beca090021e1bc26c4d9f84f003df
- Timestamp:
- 26/08/08 23:27:56 (3 months ago)
- git-parent:
- Files:
-
- include/vlc_demux.h (modified) (1 diff)
- include/vlc_input.h (modified) (1 diff)
- include/vlc_stream.h (modified) (1 diff)
- modules/control/hotkeys.c (modified) (1 diff)
- modules/demux/ts.c (modified) (5 diffs)
- modules/gui/qt4/components/interface_widgets.cpp (modified) (2 diffs)
- src/input/control.c (modified) (2 diffs)
- src/input/decoder.c (modified) (4 diffs)
- src/input/demux.c (modified) (2 diffs)
- src/input/input.c (modified) (10 diffs)
- src/input/input_internal.h (modified) (4 diffs)
- src/input/stream.c (modified) (11 diffs)
- src/input/var.c (modified) (6 diffs)
- src/libvlc-module.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_demux.h
r915ba6e raa407ea 125 125 DEMUX_GET_ATTACHMENTS, /* arg1=input_attachment_t***, int* res=can fail */ 126 126 127 /* RECORD you should accept it only if the stream can be recorded without 128 * any modification or header addition. */ 129 DEMUX_CAN_RECORD, /* arg1=bool* res=can fail(assume false) */ 130 DEMUX_SET_RECORD_STATE, /* arg1=bool res=can fail */ 131 132 127 133 /* II. Specific access_demux queries */ 128 DEMUX_CAN_PAUSE ,/* arg1= bool* can fail (assume false)*/134 DEMUX_CAN_PAUSE = 0x1000, /* arg1= bool* can fail (assume false)*/ 129 135 DEMUX_SET_PAUSE_STATE, /* arg1= bool can fail */ 130 136 include/vlc_input.h
r6baf831 raa407ea 525 525 526 526 /* On the fly input slave */ 527 INPUT_ADD_SLAVE /* arg1= char * */ 527 INPUT_ADD_SLAVE, /* arg1= char * */ 528 529 /* On the fly record while playing */ 530 INPUT_SET_RECORD_STATE, /* arg1=bool res=can fail */ 531 INPUT_GET_RECORD_STATE, /* arg1=bool* res=can fail */ 528 532 }; 529 533 include/vlc_stream.h
rebd8003 raa407ea 65 65 if access unreachable or access control answer */ 66 66 67 STREAM_GET_CONTENT_TYPE, /**< arg1= char ** res=can file */ 67 STREAM_GET_CONTENT_TYPE, /**< arg1= char ** res=can fail */ 68 69 /* SET_RECORD: 70 * XXX only data read through stream_Read/Block will be recorded */ 71 STREAM_SET_RECORD_STATE, /**< arg1=bool, arg2=const char *psz_ext (if arg1 is true) res=can fail */ 68 72 }; 69 73 modules/control/hotkeys.c
r2feb063 raa407ea 811 811 osd_MenuActivate( VLC_OBJECT(p_intf) ); 812 812 } 813 else if( i_action == ACTIONID_RECORD ) 814 { 815 if( var_GetBool( p_input, "can-record" ) ) 816 { 817 const bool b_record = !var_GetBool( p_input, "record" ); 818 819 if( b_record ) 820 vout_OSDMessage( p_intf, DEFAULT_CHAN, _("Recording") ); 821 else 822 vout_OSDMessage( p_intf, DEFAULT_CHAN, _("Recording done") ); 823 var_SetBool( p_input, "record", b_record ); 824 } 825 } 813 826 } 814 827 if( p_vout ) modules/demux/ts.c
ra060c85 raa407ea 371 371 /* */ 372 372 bool b_meta; 373 374 /* */ 375 bool b_start_record; 373 376 }; 374 377 … … 643 646 p_sys->i_ts_read = 50; 644 647 p_sys->csa = NULL; 648 p_sys->b_start_record = false; 645 649 646 650 /* Init PAT handler */ … … 1092 1096 } 1093 1097 1098 if( p_sys->b_start_record ) 1099 { 1100 /* Enable recording once synchronized */ 1101 stream_Control( p_demux->s, STREAM_SET_RECORD_STATE, true, "ts" ); 1102 p_sys->b_start_record = false; 1103 } 1104 1094 1105 if( p_sys->b_udp_out ) 1095 1106 { … … 1191 1202 demux_sys_t *p_sys = p_demux->p_sys; 1192 1203 double f, *pf; 1204 bool b_bool, *pb_bool; 1193 1205 int64_t i64; 1194 1206 int64_t *pi64; … … 1386 1398 return VLC_SUCCESS; 1387 1399 } 1400 1401 case DEMUX_CAN_RECORD: 1402 pb_bool = (bool*)va_arg( args, bool * ); 1403 *pb_bool = true; 1404 return VLC_SUCCESS; 1405 1406 case DEMUX_SET_RECORD_STATE: 1407 b_bool = (bool)va_arg( args, int ); 1408 1409 if( !b_bool ) 1410 stream_Control( p_demux->s, STREAM_SET_RECORD_STATE, false ); 1411 p_sys->b_start_record = b_bool; 1412 return VLC_SUCCESS; 1388 1413 1389 1414 case DEMUX_GET_FPS: modules/gui/qt4/components/interface_widgets.cpp
rfce957a raa407ea 373 373 i_input_id = p_item->i_id; 374 374 375 if( var_Type( THEMIM->getInput(), "record-toggle" ) == VLC_VAR_VOID ) 376 recordButton->setVisible( true ); 377 else 378 recordButton->setVisible( false ); 375 recordButton->setVisible( var_GetBool( THEMIM->getInput(), "can-record" ) ); 379 376 } 380 377 else 378 { 381 379 recordButton->setVisible( false ); 380 } 382 381 383 382 ABButton->setEnabled( enable ); … … 465 464 { 466 465 /* This method won't work fine if the stream can't be cut anywhere */ 467 if( var_Type( p_input, "record-toggle" ) == VLC_VAR_VOID )468 var_TriggerCallback( p_input, "record-toggle");466 const bool b_recording = var_GetBool( p_input, "record" ); 467 var_SetBool( p_input, "record", !b_recording ); 469 468 #if 0 470 469 else src/input/control.c
rd11fd0d raa407ea 64 64 65 65 int i_int, *pi_int; 66 bool b_bool, *pb_bool; 66 67 double f, *pf; 67 68 int64_t i_64, *pi_64; … … 599 600 } 600 601 602 case INPUT_SET_RECORD_STATE: 603 b_bool = (bool)va_arg( args, int ); 604 var_SetBool( p_input, "record", b_bool ); 605 return VLC_SUCCESS; 606 607 case INPUT_GET_RECORD_STATE: 608 pb_bool = (bool*)va_arg( args, bool* ); 609 *pb_bool = var_GetBool( p_input, "record" ); 610 return VLC_SUCCESS; 601 611 602 612 default: src/input/decoder.c
r4ca1e8b raa407ea 735 735 } 736 736 737 738 static void optimize_video_pts( decoder_t *p_dec ) 739 { 740 picture_t * oldest_pict = NULL; 741 picture_t * youngest_pict = NULL; 737 static void DecoderOptimizePtsDelay( decoder_t *p_dec ) 738 { 739 input_thread_t *p_input = p_dec->p_owner->p_input; 740 vout_thread_t *p_vout = p_dec->p_owner->p_vout; 741 input_thread_private_t *p_priv = p_input->p; 742 743 picture_t *p_old = NULL; 744 picture_t *p_young = NULL; 742 745 int i; 743 746 744 input_thread_t * p_input = p_dec->p_owner->p_input;745 vout_thread_t * p_vout = p_dec->p_owner->p_vout;746 input_thread_private_t * p_priv = p_input->p;747 748 747 /* Enable with --auto-adjust-pts-delay */ 749 if( !p_priv->pts_adjust.auto_adjust ) return; 748 if( !p_priv->pts_adjust.b_auto_adjust ) 749 return; 750 750 751 751 for( i = 0; i < I_RENDERPICTURES; i++ ) 752 752 { 753 picture_t * pic = PP_RENDERPICTURE[i]; 754 if( pic->i_status != READY_PICTURE ) 753 picture_t *p_pic = PP_RENDERPICTURE[i]; 754 755 if( p_pic->i_status != READY_PICTURE ) 755 756 continue; 756 757 757 if( ! oldest_pict || pic->date < oldest_pict->date )758 oldest_pict =pic;759 if( ! youngest_pict || pic->date > youngest_pict->date )760 youngest_pict =pic;761 } 762 763 if( ! youngest_pict || !oldest_pict)758 if( !p_old || p_pic->date < p_old->date ) 759 p_old = p_pic; 760 if( !p_young || p_pic->date > p_young->date ) 761 p_young = p_pic; 762 } 763 764 if( !p_young || !p_old ) 764 765 return; 765 766 … … 776 777 * why we may end up in having a negative pts_delay, 777 778 * to compensate that artificial delay. */ 778 mtime_t buffer_size = youngest_pict->date - oldest_pict->date;779 int64_t pts_slide = 0;780 if( buffer_size< 10000 )779 const mtime_t i_buffer_length = p_young->date - p_old->date; 780 int64_t i_pts_slide = 0; 781 if( i_buffer_length < 10000 ) 781 782 { 782 783 if( p_priv->pts_adjust.i_num_faulty > 10 ) 783 784 { 784 pts_slide = __MAX(p_input->i_pts_delay *3 / 2, 10000);785 i_pts_slide = __MAX(p_input->i_pts_delay *3 / 2, 10000); 785 786 p_priv->pts_adjust.i_num_faulty = 0; 786 787 } 787 if( p_priv->pts_adjust. to_high )788 { 789 p_priv->pts_adjust. to_high = !p_priv->pts_adjust.to_high;788 if( p_priv->pts_adjust.b_to_high ) 789 { 790 p_priv->pts_adjust.b_to_high = !p_priv->pts_adjust.b_to_high; 790 791 p_priv->pts_adjust.i_num_faulty = 0; 791 792 } 792 793 p_priv->pts_adjust.i_num_faulty++; 793 794 } 794 else if( buffer_size> 100000 )795 else if( i_buffer_length > 100000 ) 795 796 { 796 797 if( p_priv->pts_adjust.i_num_faulty > 25 ) 797 798 { 798 pts_slide = -buffer_size/2;799 i_pts_slide = -i_buffer_length/2; 799 800 p_priv->pts_adjust.i_num_faulty = 0; 800 801 } 801 if( p_priv->pts_adjust. to_high )802 { 803 p_priv->pts_adjust. to_high = !p_priv->pts_adjust.to_high;802 if( p_priv->pts_adjust.b_to_high ) 803 { 804 p_priv->pts_adjust.b_to_high = !p_priv->pts_adjust.b_to_high; 804 805 p_priv->pts_adjust.i_num_faulty = 0; 805 806 } 806 807 p_priv->pts_adjust.i_num_faulty++; 807 808 } 808 if( pts_slide)809 { 810 mtime_t origi_delay= p_input->i_pts_delay;811 812 p_input->i_pts_delay += pts_slide;809 if( i_pts_slide != 0 ) 810 { 811 const mtime_t i_pts_delay_org = p_input->i_pts_delay; 812 813 p_input->i_pts_delay += i_pts_slide; 813 814 814 815 /* Don't play with the pts delay for more than -2<->3sec */ … … 817 818 else if( p_input->i_pts_delay > 3000000 ) 818 819 p_input->i_pts_delay = 3000000; 819 pts_slide = p_input->i_pts_delay - origi_delay;820 i_pts_slide = p_input->i_pts_delay - i_pts_delay_org; 820 821 821 822 msg_Dbg( p_input, "Sliding the pts by %dms pts delay at %dms picture buffer was %dms", 822 (int) pts_slide/1000, (int)p_input->i_pts_delay/1000, (int)buffer_size/1000);823 (int)i_pts_slide/1000, (int)p_input->i_pts_delay/1000, (int)i_buffer_length/1000); 823 824 824 825 vlc_mutex_lock( &p_vout->picture_lock ); 825 826 /* Slide all the picture */ 826 827 for( i = 0; i < I_RENDERPICTURES; i++ ) 827 PP_RENDERPICTURE[i]->date += pts_slide;828 PP_RENDERPICTURE[i]->date += i_pts_slide; 828 829 /* FIXME: slide aout/spu */ 829 830 vlc_mutex_unlock( &p_vout->picture_lock ); 830 831 831 } 832 832 } … … 873 873 vout_DatePicture( p_vout, p_pic, p_pic->date ); 874 874 875 optimize_video_pts( p_dec );875 DecoderOptimizePtsDelay( p_dec ); 876 876 877 877 vout_DisplayPicture( p_vout, p_pic ); src/input/demux.c
r7979cfc raa407ea 281 281 case DEMUX_SET_GROUP: 282 282 case DEMUX_GET_ATTACHMENTS: 283 case DEMUX_CAN_RECORD: 284 case DEMUX_SET_RECORD_STATE: 283 285 return VLC_EGENERIC; 284 286 … … 527 529 case STREAM_CONTROL_ACCESS: 528 530 case STREAM_GET_CONTENT_TYPE: 531 case STREAM_SET_RECORD_STATE: 529 532 return VLC_EGENERIC; 530 533 src/input/input.c
rdd68bab raa407ea 113 113 * or not, for that check position != 0.0) 114 114 * - can-pause 115 * - can-record (if a stream can be recorded while playing) 115 116 * - teletext-es to get the index of spu track that is teletext --1 if no teletext) 116 117 * * For intf callback upon changes … … 185 186 p_input->i_state = INIT_S; 186 187 p_input->p->i_rate = INPUT_RATE_DEFAULT; 188 p_input->p->b_recording = false; 187 189 TAB_INIT( p_input->p->i_bookmark, p_input->p->bookmark ); 188 190 TAB_INIT( p_input->p->i_attachment, p_input->p->attachment ); … … 236 238 input_ControlVarInit( p_input ); 237 239 240 /* */ 241 p_input->p->pts_adjust.b_auto_adjust = var_GetBool( p_input, "auto-adjust-pts-delay" ); 238 242 p_input->p->input.i_cr_average = var_GetInteger( p_input, "cr-average" ); 239 243 … … 1453 1457 { 1454 1458 double f_pos; 1459 1460 if( p_input->p->b_recording ) 1461 { 1462 msg_Err( p_input, "INPUT_CONTROL_SET_POSITION(_OFFSET) ignored while recording" ); 1463 break; 1464 } 1455 1465 if( i_type == INPUT_CONTROL_SET_POSITION ) 1456 1466 { … … 1489 1499 int64_t i_time; 1490 1500 int i_ret; 1501 1502 if( p_input->p->b_recording ) 1503 { 1504 msg_Err( p_input, "INPUT_CONTROL_SET_TIME(_OFFSET) ignored while recording" ); 1505 break; 1506 } 1491 1507 1492 1508 if( i_type == INPUT_CONTROL_SET_TIME ) … … 1745 1761 case INPUT_CONTROL_SET_TITLE_NEXT: 1746 1762 case INPUT_CONTROL_SET_TITLE_PREV: 1763 if( p_input->p->b_recording ) 1764 { 1765 msg_Err( p_input, "INPUT_CONTROL_SET_TITLE(*) ignored while recording" ); 1766 break; 1767 } 1747 1768 if( p_input->p->input.b_title_demux && 1748 1769 p_input->p->input.i_title > 0 ) … … 1792 1813 case INPUT_CONTROL_SET_SEEKPOINT_NEXT: 1793 1814 case INPUT_CONTROL_SET_SEEKPOINT_PREV: 1815 if( p_input->p->b_recording ) 1816 { 1817 msg_Err( p_input, "INPUT_CONTROL_SET_SEEKPOINT(*) ignored while recording" ); 1818 break; 1819 } 1820 1794 1821 if( p_input->p->input.b_title_demux && 1795 1822 p_input->p->input.i_title > 0 ) … … 1919 1946 break; 1920 1947 1948 case INPUT_CONTROL_SET_RECORD_STATE: 1949 if( p_input->p->input.b_can_record ) 1950 { 1951 if( !!p_input->p->b_recording != !!val.b_bool ) 1952 { 1953 if( demux_Control( p_input->p->input.p_demux, 1954 DEMUX_SET_RECORD_STATE, val.b_bool ) ) 1955 val.b_bool = false; 1956 1957 p_input->p->b_recording = val.b_bool; 1958 } 1959 1960 var_Change( p_input, "record", VLC_VAR_SETVALUE, &val, NULL ); 1961 1962 b_force_update = true; 1963 } 1964 break; 1965 1921 1966 case INPUT_CONTROL_SET_BOOKMARK: 1922 1967 default: … … 2057 2102 static input_source_t *InputSourceNew( input_thread_t *p_input ) 2058 2103 { 2059 (void)p_input;2060 input_source_t *in = (input_source_t*)malloc( sizeof( input_source_t ) );2104 VLC_UNUSED(p_input); 2105 input_source_t *in = malloc( sizeof( input_source_t ) ); 2061 2106 if( in ) 2062 2107 memset( in, 0, sizeof( input_source_t ) ); … … 2320 2365 goto error; 2321 2366 } 2367 2368 if( demux_Control( in->p_demux, DEMUX_CAN_RECORD, &in->b_can_record ) ) 2369 in->b_can_record = false; 2370 var_SetBool( p_input, "can-record", in->b_can_record ); 2322 2371 2323 2372 /* Get title from demux */ src/input/input_internal.h
r3f5d4a9 raa407ea 64 64 bool b_can_pace_control; 65 65 bool b_can_rate_control; 66 bool b_can_record; 66 67 bool b_rescale_ts; 67 68 … … 85 86 86 87 int i_rate; 88 bool b_recording; 87 89 /* */ 88 90 int64_t i_start; /* :start-time,0 by default */ … … 117 119 118 120 /* pts delay fixup */ 119 struct { 121 struct 122 { 120 123 int i_num_faulty; 121 bool to_high;122 bool auto_adjust;124 bool b_to_high; 125 bool b_auto_adjust; 123 126 } pts_adjust; 124 127 … … 192 195 193 196 INPUT_CONTROL_ADD_SLAVE, 197 198 INPUT_CONTROL_SET_RECORD_STATE, 194 199 }; 195 200 src/input/stream.c
r3f5d4a9 raa407ea 26 26 #endif 27 27 28 #include <dirent.h> 29 28 30 #include <vlc_common.h> 31 #include <vlc_charset.h> 32 #include <vlc_strings.h> 33 #include <vlc_osd.h> 29 34 30 35 #include <assert.h> … … 187 192 /* Preparse mode ? */ 188 193 bool b_quick; 194 195 /* */ 196 struct 197 { 198 bool b_active; 199 200 FILE *f; /* TODO it could be replaced by access_output_t one day */ 201 } record; 189 202 }; 190 203 … … 213 226 static void UStreamDestroy( stream_t *s ); 214 227 static int ASeek( stream_t *s, int64_t i_pos ); 228 static int ARecordSetState( stream_t *s, bool b_record, const char *psz_extension ); 229 static void ARecordWrite( stream_t *s, const uint8_t *p_buffer, size_t i_buffer ); 215 230 216 231 /**************************************************************************** … … 315 330 p_sys->method = Stream; 316 331 332 p_sys->record.b_active = false; 333 317 334 p_sys->i_pos = p_access->info.i_pos; 318 335 … … 513 530 vlc_object_detach( s ); 514 531 515 if( p_sys->method == Block ) block_ChainRelease( p_sys->block.p_first ); 516 else if ( p_sys->method == Immediate ) free( p_sys->immediate.p_buffer ); 517 else free( p_sys->stream.p_buffer ); 532 if( p_sys->record.b_active ) 533 ARecordSetState( s, false, NULL ); 534 535 if( p_sys->method == Block ) 536 block_ChainRelease( p_sys->block.p_first ); 537 else if ( p_sys->method == Immediate ) 538 free( p_sys->immediate.p_buffer ); 539 else 540 free( p_sys->stream.p_buffer ); 518 541 519 542 free( p_sys->p_peek ); … … 618 641 619 642 bool *p_bool; 643 bool b_bool; 644 const char *psz_string; 620 645 int64_t *pi_64, i_64; 621 646 int i_int; … … 678 703 return access_Control( p_access, ACCESS_GET_CONTENT_TYPE, 679 704 va_arg( args, char ** ) ); 705 case STREAM_SET_RECORD_STATE: 706 b_bool = (bool)va_arg( args, int ); 707 psz_string = NULL; 708 if( b_bool ) 709 psz_string = (const char*)va_arg( args, const char* ); 710 return ARecordSetState( s, b_bool, psz_string ); 680 711 681 712 default: … … 686 717 } 687 718 688 719 /**************************************************************************** 720 * ARecord*: record stream functions 721 ****************************************************************************/ 722 723 /* TODO FIXME nearly the same logic that snapshot code */ 724 static char *ARecordGetFileName( stream_t *s, const char *psz_path, const char *psz_prefix, const char *psz_extension ) 725 { 726 char *psz_file; 727 DIR *path; 728 729 path = utf8_opendir( psz_path ); 730 if( path ) 731 { 732 closedir( path ); 733 734 const char *psz_prefix = "vlc-record-%Y-%m-%d-%H:%M:%S-$p"; // TODO allow conf ? 735 char *psz_tmp = str_format( s, psz_prefix ); 736 if( !psz_tmp ) 737 return NULL; 738 739 filename_sanitize( psz_tmp ); 740 if( asprintf( &psz_file, "%s"DIR_SEP"%s.%s", 741 psz_path, psz_tmp, psz_extension ) < 0 ) 742 psz_file = NULL; 743 free( psz_tmp ); 744 return psz_file; 745 } 746 else 747 { 748 psz_file = str_format( s, psz_path ); 749 path_sanitize( psz_file ); 750 return psz_file; 751 } 752 } 753 754 static int ARecordStart( stream_t *s, const char *psz_extension ) 755 { 756 stream_sys_t *p_sys = s->p_sys; 757 758 DIR *path; 759 char *psz_file; 760 FILE *f; 761 762 /* */ 763 if( !psz_extension ) 764 psz_extension = "dat"; 765 766 /* Retreive path */ 767 char *psz_path = var_CreateGetString( s, "input-record-path" ); 768 if( !psz_path || *psz_path == '\0' ) 769 { 770 free( psz_path ); 771 psz_path = strdup( config_GetHomeDir() ); 772 } 773 774 if( !psz_path ) 775 return VLC_ENOMEM; 776 777 /* Create file name 778 * TODO allow prefix configuration */ 779 psz_file = ARecordGetFileName( s, psz_path, "vlc-record-%Y-%m-%d-%H:%M:%S-$p", psz_extension ); 780 781 free( psz_path ); 782 783 if( !psz_file ) 784 return VLC_ENOMEM; 785 786 f = utf8_fopen( psz_file, "wb" ); 787 if( !f ) 788 { 789 free( psz_file ); 790 return VLC_EGENERIC; 791 } 792 msg_Dbg( s, "Recording into %s", psz_file ); 793 free( psz_file ); 794 795 /* */ 796 p_sys->record.f = f; 797 p_sys->record.b_active = true; 798 return VLC_SUCCESS; 799 } 800 static int ARecordStop( stream_t *s ) 801 { 802 stream_sys_t *p_sys = s->p_sys; 803 804 assert( p_sys->record.b_active ); 805 806 msg_Dbg( s, "Recording completed" ); 807 fclose( p_sys->record.f ); 808 p_sys->record.b_active = false; 809 return VLC_SUCCESS; 810 } 811 812 static int ARecordSetState( stream_t *s, bool b_record, const char *psz_extension ) 813 { 814 stream_sys_t *p_sys = s->p_sys; 815 816 if( !!p_sys->record.b_active == !!b_record ) 817 return VLC_SUCCESS; 818 819 if( b_record ) 820 return ARecordStart( s, psz_extension ); 821 else 822 return ARecordStop( s ); 823 } 824 static void ARecordWrite( stream_t *s, const uint8_t *p_buffer, size_t i_buffer ) 825 { 826 stream_sys_t *p_sys = s->p_sys; 827 828 assert( p_sys->record.b_active ); 829 830 if( i_buffer ) 831 fwrite( p_buffer, 1, i_buffer, p_sys->record.f ); 832 } 689 833 690 834 /**************************************************************************** … … 822 966 } 823 967 968 if( p_sys->record.b_active && i_data > 0 ) 969 ARecordWrite( s, p_read, i_data ); 970 824 971 p_sys->i_pos += i_data; 825 972 return i_data; … … 1165 1312 } 1166 1313 } 1314 1315 if( p_sys->record.b_active && i_data > 0 ) 1316 ARecordWrite( s, p_read, i_data ); 1167 1317 1168 1318 return i_data; … … 1552 1702 } 1553 1703 } 1704 1705 if( p_sys->record.b_active && i_copy > 0 ) 1706 ARecordWrite( s, p_read, i_copy ); 1554 1707 1555 1708 p_sys->i_pos += i_to_read; src/input/var.c
r94ae971 raa407ea 62 62 vlc_value_t oldval, vlc_value_t newval, void * ); 63 63 64 static int RecordCallback( vlc_object_t *p_this, char const *psz_cmd, 65 vlc_value_t oldval, vlc_value_t newval, 66 void *p_data ); 67 64 68 typedef struct 65 69 { … … 94 98 CALLBACK( "audio-es", ESCallback ), 95 99 CALLBACK( "spu-es", ESCallback ), 100 CALLBACK( "record", RecordCallback ), 96 101 97 102 CALLBACK( NULL, NULL ) … … 189 194 val.i_time = 0; 190 195 var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val, NULL ); 191 192 p_input->p->pts_adjust.auto_adjust = var_CreateGetBool(193 p_input, "auto-adjust-pts-delay" );194 196 195 197 /* Video ES */ … … 405 407 void input_ConfigVarInit ( input_thread_t *p_input ) 406 408 { 407 vlc_value_t val;408 409 409 /* Create Object Variables for private use only */ 410 410 … … 461 461 var_Create( p_input, "clock-synchro", 462 462 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT); 463 var_Create( p_input, "auto-adjust-pts-delay", 464 VLC_VAR_BOOL | VLC_VAR_DOINHERIT); 463 465 } 464 466 465 467 var_Create( p_input, "seekable", VLC_VAR_BOOL ); 466 va l.b_bool = true; /* Fixed later*/467 var_Change( p_input, "seekable", VLC_VAR_SETVALUE, &val, NULL ); 468 var_SetBool( p_input, "seekable", true ); /* Fixed later*/ 469 468 470 var_Create( p_input, "can-pause", VLC_VAR_BOOL ); 469 val.b_bool = true; /* Fixed later*/ 470 var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL ); 471 var_SetBool( p_input, "can-pause", true ); /* Fixed later*/ 472 473 var_Create( p_input, "can-record", VLC_VAR_BOOL ); 474 var_SetBool( p_input, "can-record", false ); /* Fixed later*/ 475 476 var_Create( p_input, "record", VLC_VAR_BOOL ); 477 var_SetBool( p_input, "record", false ); 478 471 479 var_Create( p_input, "teletext-es", VLC_VAR_INTEGER ); 472 480 var_SetInteger( p_input, "teletext-es", -1 ); … … 777 785 return VLC_SUCCESS; 778 786 } 787 788 static int RecordCallback( vlc_object_t *p_this, char const *psz_cmd, 789 vlc_value_t oldval, vlc_value_t newval, 790 void *p_data ) 791 { 792 input_thread_t *p_input = (input_thread_t*)p_this; 793 VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data); 794 795 input_ControlPush( p_input, INPUT_CONTROL_SET_RECORD_STATE, &newval ); 796 797 return VLC_SUCCESS; 798 } src/libvlc-module.c
reff2497 raa407ea 676 676 "bytes=optional-byte-offset},{...}\"") 677 677 678 #define INPUT_RECORD_PATH_TEXT N_("Record directory or filename") 679 #define INPUT_RECORD_PATH_LONGTEXT N_( \ 680 "Directory or filename where the records will be stored" ) 681 678 682 // DEPRECATED 679 683 #define SUB_CAT_LONGTEXT N_( \ … … 1737 1741 add_bool( "network-synchronisation", false, NULL, NETSYNC_TEXT, 1738 1742 NETSYNC_LONGTEXT, true ); 1743 1744 add_string( "input-record-path", NULL, NULL, INPUT_RECORD_PATH_TEXT, 1745 INPUT_RECORD_PATH_LONGTEXT, true ); 1739 1746 1740 1747 /* Decoder options */
