1 /*****************************************************************************
2 * dynamicoverlay_commands.c : dynamic overlay plugin commands
3 *****************************************************************************
4 * Copyright (C) 2008 the VideoLAN team
7 * Author: Søren Bøg <avacore@videolan.org>
8 * Jean-Paul Saman <jpsaman@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
29 #include <vlc_common.h>
30 #include <vlc_arrays.h>
32 #include <vlc_filter.h>
38 #if defined(HAVE_SYS_SHM_H)
42 #include "dynamicoverlay.h"
45 /*****************************************************************************
46 * overlay_t: Overlay descriptor
47 *****************************************************************************/
49 overlay_t *OverlayCreate( void )
51 overlay_t *p_ovl = calloc( 1, sizeof( overlay_t ) );
55 p_ovl->i_x = p_ovl->i_y = 0;
56 p_ovl->i_alpha = 0xFF;
57 p_ovl->b_active = false;
58 video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
60 p_ovl->p_fontstyle = text_style_New();
61 p_ovl->data.p_text = NULL;
66 int OverlayDestroy( overlay_t *p_ovl )
68 free( p_ovl->data.p_text );
69 text_style_Delete( p_ovl->p_fontstyle );
74 /*****************************************************************************
76 *****************************************************************************/
77 static int skip_space( char **psz_command )
79 char *psz_temp = *psz_command;
81 while( isspace( *psz_temp ) )
85 if( psz_temp == *psz_command )
89 *psz_command = psz_temp;
93 static int parse_digit( char **psz_command, int32_t *value )
96 *value = strtol( *psz_command, &psz_temp, 10 );
97 if( psz_temp == *psz_command )
101 *psz_command = psz_temp;
105 static int parse_char( char **psz_command, char **psz_end,
106 int count, char *psz_value )
108 if( *psz_end - *psz_command < count )
112 memcpy( psz_value, *psz_command, count );
113 *psz_command += count;
117 static int parser_DataSharedMem( char *psz_command,
119 commandparams_t *p_params )
121 /* Parse: 0 128 128 RGBA 9404459 */
122 skip_space( &psz_command );
123 if( isdigit( *psz_command ) )
125 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
128 skip_space( &psz_command );
129 if( isdigit( *psz_command ) )
131 if( parse_digit( &psz_command, &p_params->i_width ) == VLC_EGENERIC )
134 skip_space( &psz_command );
135 if( isdigit( *psz_command ) )
137 if( parse_digit( &psz_command, &p_params->i_height ) == VLC_EGENERIC )
140 skip_space( &psz_command );
141 if( isascii( *psz_command ) )
143 if( parse_char( &psz_command, &psz_end, 4, (char*)&p_params->fourcc )
147 skip_space( &psz_command );
148 if( isdigit( *psz_command ) )
150 if( parse_digit( &psz_command, &p_params->i_shmid ) == VLC_EGENERIC )
156 static int parser_Id( char *psz_command, char *psz_end,
157 commandparams_t *p_params )
160 skip_space( &psz_command );
161 if( isdigit( *psz_command ) )
163 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
169 static int parser_None( char *psz_command, char *psz_end,
170 commandparams_t *p_params )
172 VLC_UNUSED(psz_command);
174 VLC_UNUSED(p_params);
178 static int parser_SetAlpha( char *psz_command, char *psz_end,
179 commandparams_t *p_params )
182 skip_space( &psz_command );
183 if( isdigit( *psz_command ) )
185 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
188 skip_space( &psz_command );
189 if( isdigit( *psz_command ) )
191 if( parse_digit( &psz_command, &p_params->i_alpha ) == VLC_EGENERIC )
197 static int parser_SetPosition( char *psz_command, char *psz_end,
198 commandparams_t *p_params )
201 skip_space( &psz_command );
202 if( isdigit( *psz_command ) )
204 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
207 skip_space( &psz_command );
208 if( isdigit( *psz_command ) )
210 if( parse_digit( &psz_command, &p_params->i_x ) == VLC_EGENERIC )
213 skip_space( &psz_command );
214 if( isdigit( *psz_command ) )
216 if( parse_digit( &psz_command, &p_params->i_y ) == VLC_EGENERIC )
222 static int parser_SetTextAlpha( char *psz_command, char *psz_end,
223 commandparams_t *p_params )
226 skip_space( &psz_command );
227 if( isdigit( *psz_command ) )
229 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
232 skip_space( &psz_command );
233 if( isdigit( *psz_command ) )
235 if( parse_digit( &psz_command, &p_params->fontstyle.i_font_alpha ) == VLC_EGENERIC )
241 static int parser_SetTextColor( char *psz_command, char *psz_end,
242 commandparams_t *p_params )
244 int r = 0, g = 0, b = 0;
247 skip_space( &psz_command );
248 if( isdigit( *psz_command ) )
250 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
253 skip_space( &psz_command );
254 if( isdigit( *psz_command ) )
256 if( parse_digit( &psz_command, &r ) == VLC_EGENERIC )
259 skip_space( &psz_command );
260 if( isdigit( *psz_command ) )
262 if( parse_digit( &psz_command, &g ) == VLC_EGENERIC )
265 skip_space( &psz_command );
266 if( isdigit( *psz_command ) )
268 if( parse_digit( &psz_command, &b ) == VLC_EGENERIC )
271 p_params->fontstyle.i_font_color = (r<<16) | (g<<8) | (b<<0);
275 static int parser_SetTextSize( char *psz_command, char *psz_end,
276 commandparams_t *p_params )
279 skip_space( &psz_command );
280 if( isdigit( *psz_command ) )
282 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
285 skip_space( &psz_command );
286 if( isdigit( *psz_command ) )
288 if( parse_digit( &psz_command, &p_params->fontstyle.i_font_size ) == VLC_EGENERIC )
294 static int parser_SetVisibility( char *psz_command, char *psz_end,
295 commandparams_t *p_params )
298 skip_space( &psz_command );
299 if( isdigit( *psz_command ) )
301 if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
304 skip_space( &psz_command );
305 if( isdigit( *psz_command ) )
308 if( parse_digit( &psz_command, &i_vis ) == VLC_EGENERIC )
310 p_params->b_visible = (i_vis == 1) ? true : false;
315 /*****************************************************************************
316 * Command unparser functions
317 *****************************************************************************/
319 static int unparse_default( const commandparams_t *p_results,
322 VLC_UNUSED(p_results);
323 VLC_UNUSED(p_output);
327 static int unparse_GenImage( const commandparams_t *p_results,
330 int ret = BufferPrintf( p_output, " %d", p_results->i_id );
331 if( ret != VLC_SUCCESS )
337 static int unparse_GetAlpha( const commandparams_t *p_results,
340 int ret = BufferPrintf( p_output, " %d", p_results->i_alpha );
341 if( ret != VLC_SUCCESS )
347 static int unparse_GetPosition( const commandparams_t *p_results,
350 int ret = BufferPrintf( p_output, " %d", p_results->i_x );
351 if( ret != VLC_SUCCESS )
354 ret = BufferPrintf( p_output, " %d", p_results->i_y );
355 if( ret != VLC_SUCCESS )
361 static int unparse_GetTextAlpha( const commandparams_t *p_results,
364 int ret = BufferPrintf( p_output, " %d", p_results->fontstyle.i_font_alpha );
365 if( ret != VLC_SUCCESS )
371 static int unparse_GetTextColor( const commandparams_t *p_results,
374 int ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0xff0000)>>16 );
375 if( ret != VLC_SUCCESS )
378 ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0x00ff00)>>8 );
379 if( ret != VLC_SUCCESS )
382 ret = BufferPrintf( p_output, " %d", (p_results->fontstyle.i_font_color & 0x0000ff) );
383 if( ret != VLC_SUCCESS )
389 static int unparse_GetTextSize( const commandparams_t *p_results,
392 int ret = BufferPrintf( p_output, " %d", p_results->fontstyle.i_font_size );
393 if( ret != VLC_SUCCESS )
399 static int unparse_GetVisibility( const commandparams_t *p_results,
402 int ret = BufferPrintf( p_output, " %d", (p_results->b_visible ? 1 : 0) );
403 if( ret != VLC_SUCCESS ) {
409 /*****************************************************************************
411 *****************************************************************************/
412 static int exec_DataSharedMem( filter_t *p_filter,
413 const commandparams_t *p_params,
414 commandparams_t *p_results )
416 #if defined(HAVE_SYS_SHM_H)
417 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
418 struct shmid_ds shminfo;
422 VLC_UNUSED(p_results);
424 p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
427 msg_Err( p_filter, "Invalid overlay: %d", p_params->i_id );
431 if( shmctl( p_params->i_shmid, IPC_STAT, &shminfo ) == -1 )
433 msg_Err( p_filter, "Unable to access shared memory" );
436 i_size = shminfo.shm_segsz;
438 if( p_params->fourcc == VLC_CODEC_TEXT )
442 if( (p_params->i_height != 1) || (p_params->i_width < 1) )
445 "Invalid width and/or height. when specifying text height "
446 "must be 1 and width the number of bytes in the string, "
447 "including the null terminator" );
451 if( (size_t)p_params->i_width > i_size )
454 "Insufficient data in shared memory. need %d, got %zu",
455 p_params->i_width, i_size );
459 p_ovl->data.p_text = malloc( p_params->i_width );
460 if( p_ovl->data.p_text == NULL )
462 msg_Err( p_filter, "Unable to allocate string storage" );
466 video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
469 p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
472 msg_Err( p_filter, "Unable to attach to shared memory" );
473 free( p_ovl->data.p_text );
474 p_ovl->data.p_text = NULL;
477 memcpy( p_ovl->data.p_text, p_data, p_params->i_width );
483 uint8_t *p_data, *p_in;
484 size_t i_neededsize = 0;
486 p_ovl->data.p_pic = picture_New( p_params->fourcc,
487 p_params->i_width, p_params->i_height,
489 if( p_ovl->data.p_pic == NULL )
492 p_ovl->format = p_ovl->data.p_pic->format;
494 for( size_t i_plane = 0; i_plane < (size_t)p_ovl->data.p_pic->i_planes;
497 i_neededsize += p_ovl->data.p_pic->p[i_plane].i_visible_lines *
498 p_ovl->data.p_pic->p[i_plane].i_visible_pitch;
501 if( i_neededsize > i_size )
504 "Insufficient data in shared memory. need %zu, got %zu",
505 i_neededsize, i_size );
506 picture_Release( p_ovl->data.p_pic );
507 p_ovl->data.p_pic = NULL;
511 p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
514 msg_Err( p_filter, "Unable to attach to shared memory" );
515 picture_Release( p_ovl->data.p_pic );
516 p_ovl->data.p_pic = NULL;
521 for( size_t i_plane = 0; i_plane < (size_t)p_ovl->data.p_pic->i_planes;
524 uint8_t *p_out = p_ovl->data.p_pic->p[i_plane].p_pixels;
525 for( size_t i_line = 0;
526 i_line < (size_t)p_ovl->data.p_pic->p[i_plane].i_visible_lines;
529 vlc_memcpy( p_out, p_in,
530 p_ovl->data.p_pic->p[i_plane].i_visible_pitch );
531 p_out += p_ovl->data.p_pic->p[i_plane].i_pitch;
532 p_in += p_ovl->data.p_pic->p[i_plane].i_visible_pitch;
537 p_sys->b_updated = p_ovl->b_active;
541 VLC_UNUSED(p_params);
542 VLC_UNUSED(p_results);
544 msg_Err( p_filter, "system doesn't support shared memory" );
549 static int exec_DeleteImage( filter_t *p_filter,
550 const commandparams_t *p_params,
551 commandparams_t *p_results )
553 VLC_UNUSED(p_results);
554 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
555 p_sys->b_updated = true;
557 return ListRemove( &p_sys->overlays, p_params->i_id );
560 static int exec_EndAtomic( filter_t *p_filter,
561 const commandparams_t *p_params,
562 commandparams_t *p_results )
564 VLC_UNUSED(p_params);
565 VLC_UNUSED(p_results);
566 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
567 QueueTransfer( &p_sys->pending, &p_sys->atomic );
568 p_sys->b_atomic = false;
572 static int exec_GenImage( filter_t *p_filter,
573 const commandparams_t *p_params,
574 commandparams_t *p_results )
576 VLC_UNUSED(p_params);
577 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
579 overlay_t *p_ovl = OverlayCreate();
583 ssize_t i_idx = ListAdd( &p_sys->overlays, p_ovl );
587 p_results->i_id = i_idx;
591 static int exec_GetAlpha( filter_t *p_filter,
592 const commandparams_t *p_params,
593 commandparams_t *p_results )
595 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
596 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
600 p_results->i_alpha = p_ovl->i_alpha;
604 static int exec_GetPosition( filter_t *p_filter,
605 const commandparams_t *p_params,
606 commandparams_t *p_results )
608 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
609 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
613 p_results->i_x = p_ovl->i_x;
614 p_results->i_y = p_ovl->i_y;
618 static int exec_GetTextAlpha( filter_t *p_filter,
619 const commandparams_t *p_params,
620 commandparams_t *p_results )
622 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
623 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
627 p_results->fontstyle.i_font_alpha = p_ovl->p_fontstyle->i_font_alpha;
631 static int exec_GetTextColor( filter_t *p_filter,
632 const commandparams_t *p_params,
633 commandparams_t *p_results )
635 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
636 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
640 p_results->fontstyle.i_font_color = p_ovl->p_fontstyle->i_font_color;
644 static int exec_GetTextSize( filter_t *p_filter,
645 const commandparams_t *p_params,
646 commandparams_t *p_results )
648 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
649 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
653 p_results->fontstyle.i_font_size = p_ovl->p_fontstyle->i_font_size;
657 static int exec_GetVisibility( filter_t *p_filter,
658 const commandparams_t *p_params,
659 commandparams_t *p_results )
661 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
663 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
667 p_results->b_visible = ( p_ovl->b_active == true ) ? 1 : 0;
671 static int exec_SetAlpha( filter_t *p_filter,
672 const commandparams_t *p_params,
673 commandparams_t *p_results )
675 VLC_UNUSED(p_results);
676 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
678 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
682 p_ovl->i_alpha = p_params->i_alpha;
683 p_sys->b_updated = p_ovl->b_active;
687 static int exec_SetPosition( filter_t *p_filter,
688 const commandparams_t *p_params,
689 commandparams_t *p_results )
691 VLC_UNUSED(p_results);
692 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
694 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
698 p_ovl->i_x = p_params->i_x;
699 p_ovl->i_y = p_params->i_y;
701 p_sys->b_updated = p_ovl->b_active;
705 static int exec_SetTextAlpha( filter_t *p_filter,
706 const commandparams_t *p_params,
707 commandparams_t *p_results )
709 VLC_UNUSED(p_results);
710 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
712 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
716 p_ovl->p_fontstyle->i_font_alpha = p_params->fontstyle.i_font_alpha;
717 p_sys->b_updated = p_ovl->b_active;
721 static int exec_SetTextColor( filter_t *p_filter,
722 const commandparams_t *p_params,
723 commandparams_t *p_results )
725 VLC_UNUSED(p_results);
726 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
728 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
732 p_ovl->p_fontstyle->i_font_color = p_params->fontstyle.i_font_color;
733 p_sys->b_updated = p_ovl->b_active;
737 static int exec_SetTextSize( filter_t *p_filter,
738 const commandparams_t *p_params,
739 commandparams_t *p_results )
741 VLC_UNUSED(p_results);
742 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
744 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
748 p_ovl->p_fontstyle->i_font_size = p_params->fontstyle.i_font_size;
749 p_sys->b_updated = p_ovl->b_active;
753 static int exec_SetVisibility( filter_t *p_filter,
754 const commandparams_t *p_params,
755 commandparams_t *p_results )
757 VLC_UNUSED(p_results);
758 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
760 overlay_t *p_ovl = ListGet( &p_sys->overlays, p_params->i_id );
764 p_ovl->b_active = p_params->b_visible;// ? false : true;
765 p_sys->b_updated = true;
769 static int exec_StartAtomic( filter_t *p_filter,
770 const commandparams_t *p_params,
771 commandparams_t *p_results )
773 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
774 VLC_UNUSED(p_params);
775 VLC_UNUSED(p_results);
777 p_sys->b_atomic = true;
781 /*****************************************************************************
783 *****************************************************************************/
784 static const commanddesc_static_t p_commands[] =
786 { .psz_command = "DataSharedMem",
788 .pf_parser = parser_DataSharedMem,
789 .pf_execute = exec_DataSharedMem,
790 .pf_unparse = unparse_default,
792 { .psz_command = "DeleteImage",
794 .pf_parser = parser_Id,
795 .pf_execute = exec_DeleteImage,
796 .pf_unparse = unparse_default,
798 { .psz_command = "EndAtomic",
800 .pf_parser = parser_None,
801 .pf_execute = exec_EndAtomic,
802 .pf_unparse = unparse_default,
804 { .psz_command = "GenImage",
806 .pf_parser = parser_None,
807 .pf_execute = exec_GenImage,
808 .pf_unparse = unparse_GenImage,
810 { .psz_command = "GetAlpha",
812 .pf_parser = parser_Id,
813 .pf_execute = exec_GetAlpha,
814 .pf_unparse = unparse_GetAlpha,
816 { .psz_command = "GetPosition",
818 .pf_parser = parser_Id,
819 .pf_execute = exec_GetPosition,
820 .pf_unparse = unparse_GetPosition,
822 { .psz_command = "GetTextAlpha",
824 .pf_parser = parser_Id,
825 .pf_execute = exec_GetTextAlpha,
826 .pf_unparse = unparse_GetTextAlpha,
828 { .psz_command = "GetTextColor",
830 .pf_parser = parser_Id,
831 .pf_execute = exec_GetTextColor,
832 .pf_unparse = unparse_GetTextColor,
834 { .psz_command = "GetTextSize",
836 .pf_parser = parser_Id,
837 .pf_execute = exec_GetTextSize,
838 .pf_unparse = unparse_GetTextSize,
840 { .psz_command = "GetVisibility",
842 .pf_parser = parser_Id,
843 .pf_execute = exec_GetVisibility,
844 .pf_unparse = unparse_GetVisibility,
846 { .psz_command = "SetAlpha",
848 .pf_parser = parser_SetAlpha,
849 .pf_execute = exec_SetAlpha,
850 .pf_unparse = unparse_default,
852 { .psz_command = "SetPosition",
854 .pf_parser = parser_SetPosition,
855 .pf_execute = exec_SetPosition,
856 .pf_unparse = unparse_default,
858 { .psz_command = "SetTextAlpha",
860 .pf_parser = parser_SetTextAlpha,
861 .pf_execute = exec_SetTextAlpha,
862 .pf_unparse = unparse_default,
864 { .psz_command = "SetTextColor",
866 .pf_parser = parser_SetTextColor,
867 .pf_execute = exec_SetTextColor,
868 .pf_unparse = unparse_default,
870 { .psz_command = "SetTextSize",
872 .pf_parser = parser_SetTextSize,
873 .pf_execute = exec_SetTextSize,
874 .pf_unparse = unparse_default,
876 { .psz_command = "SetVisibility",
878 .pf_parser = parser_SetVisibility,
879 .pf_execute = exec_SetVisibility,
880 .pf_unparse = unparse_default,
882 { .psz_command = "StartAtomic",
884 .pf_parser = parser_None,
885 .pf_execute = exec_StartAtomic,
886 .pf_unparse = unparse_default,
890 void RegisterCommand( filter_t *p_filter )
892 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
895 p_sys->i_commands = ARRAY_SIZE(p_commands);
896 p_sys->pp_commands = (commanddesc_t **) calloc( p_sys->i_commands, sizeof(commanddesc_t*) );
897 if( !p_sys->pp_commands ) return;
898 for( i_index = 0; i_index < p_sys->i_commands; i_index ++ )
900 p_sys->pp_commands[i_index] = (commanddesc_t *) malloc( sizeof(commanddesc_t) );
901 if( !p_sys->pp_commands[i_index] ) return;
902 p_sys->pp_commands[i_index]->psz_command = strdup( p_commands[i_index].psz_command );
903 p_sys->pp_commands[i_index]->b_atomic = p_commands[i_index].b_atomic;
904 p_sys->pp_commands[i_index]->pf_parser = p_commands[i_index].pf_parser;
905 p_sys->pp_commands[i_index]->pf_execute = p_commands[i_index].pf_execute;
906 p_sys->pp_commands[i_index]->pf_unparse = p_commands[i_index].pf_unparse;
909 msg_Dbg( p_filter, "%zu commands are available", p_sys->i_commands );
910 for( size_t i_index = 0; i_index < p_sys->i_commands; i_index++ )
911 msg_Dbg( p_filter, " %s", p_sys->pp_commands[i_index]->psz_command );
914 void UnregisterCommand( filter_t *p_filter )
916 filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
919 for( i_index = 0; i_index < p_sys->i_commands; i_index++ )
921 free( p_sys->pp_commands[i_index]->psz_command );
922 free( p_sys->pp_commands[i_index] );
924 free( p_sys->pp_commands );
925 p_sys->pp_commands = NULL;
926 p_sys->i_commands = 0;