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
b19ddef0
Commit
b19ddef0
authored
Aug 29, 2006
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlcshell.cpp: prevent browser from downloading SRC URL before passing it to plugin
parent
30b3ac88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
53 deletions
+26
-53
mozilla/vlcshell.cpp
mozilla/vlcshell.cpp
+26
-53
No files found.
mozilla/vlcshell.cpp
View file @
b19ddef0
...
@@ -439,68 +439,41 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
...
@@ -439,68 +439,41 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
NPError
NPP_NewStream
(
NPP
instance
,
NPMIMEType
type
,
NPStream
*
stream
,
NPError
NPP_NewStream
(
NPP
instance
,
NPMIMEType
type
,
NPStream
*
stream
,
NPBool
seekable
,
uint16
*
stype
)
NPBool
seekable
,
uint16
*
stype
)
{
{
if
(
instance
==
NULL
)
if
(
NULL
==
instance
)
{
{
return
NPERR_INVALID_INSTANCE_ERROR
;
return
NPERR_INVALID_INSTANCE_ERROR
;
}
}
#if 0
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
instance
->
pdata
);
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
#endif
/* fprintf(stderr, "NPP_NewStream - FILE mode !!\n"); */
/* We want a *filename* ! */
/*
*
stype
=
NP_ASFILE
;
** Firefox/Mozilla may decide to open a stream from the URL specified
** in the SRC parameter of the EMBED tag and pass it to us
#if 0
**
if( !p_plugin->b_stream )
** since VLC will open the SRC URL as well, we're not interested in
** that stream. Otherwise, we'll take it and queue it up in the playlist
*/
if
(
!
p_plugin
->
psz_target
||
strcmp
(
stream
->
url
,
p_plugin
->
psz_target
)
)
{
{
p_plugin->psz_target = strdup( stream->url );
/* TODO: use pipes !!!! */
p_plugin->b_stream = VLC_TRUE;
*
stype
=
NP_ASFILEONLY
;
return
NPERR_NO_ERROR
;
}
}
#endif
return
NPERR_GENERIC_ERROR
;
return
NPERR_NO_ERROR
;
}
}
int32
STREAMBUFSIZE
=
0X0FFFFFFF
;
/* If we are reading from a file in NPAsFile
* mode so we can take any size stream in our
* write call (since we ignore it) */
#define SARASS_SIZE (1024*1024)
int32
NPP_WriteReady
(
NPP
instance
,
NPStream
*
stream
)
int32
NPP_WriteReady
(
NPP
instance
,
NPStream
*
stream
)
{
{
VlcPlugin
*
p_plugin
;
/* TODO */
return
8
*
1024
;
/* fprintf(stderr, "NPP_WriteReady\n"); */
if
(
instance
!=
NULL
)
{
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
instance
->
pdata
);
/* Muahahahahahahaha */
return
STREAMBUFSIZE
;
/*return SARASS_SIZE;*/
}
/* Number of bytes ready to accept in NPP_Write() */
return
STREAMBUFSIZE
;
/*return 0;*/
}
}
int32
NPP_Write
(
NPP
instance
,
NPStream
*
stream
,
int32
offset
,
int32
NPP_Write
(
NPP
instance
,
NPStream
*
stream
,
int32
offset
,
int32
len
,
void
*
buffer
)
int32
len
,
void
*
buffer
)
{
{
/* fprintf(stderr, "NPP_Write %i\n", (int)len); */
/* TODO */
return
len
;
if
(
instance
!=
NULL
)
{
/*VlcPlugin* p_plugin = (VlcPlugin*) instance->pdata;*/
}
return
len
;
/* The number of bytes accepted */
}
}
...
@@ -510,7 +483,6 @@ NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason )
...
@@ -510,7 +483,6 @@ NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason )
{
{
return
NPERR_INVALID_INSTANCE_ERROR
;
return
NPERR_INVALID_INSTANCE_ERROR
;
}
}
return
NPERR_NO_ERROR
;
return
NPERR_NO_ERROR
;
}
}
...
@@ -522,14 +494,15 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
...
@@ -522,14 +494,15 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
return
;
return
;
}
}
/* fprintf(stderr, "NPP_StreamAsFile %s\n", fname); */
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
instance
->
pdata
);
#if 0
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
VLC_AddTarget( p_plugin->i_vlc, fname, 0, 0,
if
(
VLC_SUCCESS
==
libvlc_playlist_add
(
p_plugin
->
getVLC
(),
fname
,
stream
->
url
,
NULL
)
)
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
{
#endif /* USE_LIBVLC */
if
(
p_plugin
->
b_autoplay
)
{
libvlc_playlist_play
(
p_plugin
->
getVLC
(),
0
,
0
,
NULL
,
NULL
);
}
}
}
}
...
...
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