Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f64e68a7
Commit
f64e68a7
authored
Jan 26, 2010
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mozilla plugin: move deinterlace to own video subobject, and fix memleak.
parent
da87f0fe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
37 deletions
+116
-37
projects/mozilla/control/npolibvlc.cpp
projects/mozilla/control/npolibvlc.cpp
+89
-32
projects/mozilla/control/npolibvlc.h
projects/mozilla/control/npolibvlc.h
+24
-2
projects/mozilla/test.html
projects/mozilla/test.html
+3
-3
No files found.
projects/mozilla/control/npolibvlc.cpp
View file @
f64e68a7
...
@@ -1252,6 +1252,16 @@ LibvlcSubtitleNPObject::invoke(int index, const NPVariant *args,
...
@@ -1252,6 +1252,16 @@ LibvlcSubtitleNPObject::invoke(int index, const NPVariant *args,
** implementation of libvlc video object
** implementation of libvlc video object
*/
*/
LibvlcVideoNPObject
::~
LibvlcVideoNPObject
()
{
if
(
isValid
()
)
{
if
(
marqueeObj
)
NPN_ReleaseObject
(
marqueeObj
);
if
(
logoObj
)
NPN_ReleaseObject
(
logoObj
);
if
(
deintObj
)
NPN_ReleaseObject
(
deintObj
);
}
}
const
NPUTF8
*
const
LibvlcVideoNPObject
::
propertyNames
[]
=
const
NPUTF8
*
const
LibvlcVideoNPObject
::
propertyNames
[]
=
{
{
"fullscreen"
,
"fullscreen"
,
...
@@ -1262,7 +1272,8 @@ const NPUTF8 * const LibvlcVideoNPObject::propertyNames[] =
...
@@ -1262,7 +1272,8 @@ const NPUTF8 * const LibvlcVideoNPObject::propertyNames[] =
"crop"
,
"crop"
,
"teletext"
,
"teletext"
,
"marquee"
,
"marquee"
,
"logo"
"logo"
,
"deinterlace"
,
};
};
enum
LibvlcVideoNPObjectPropertyIds
enum
LibvlcVideoNPObjectPropertyIds
...
@@ -1275,7 +1286,8 @@ enum LibvlcVideoNPObjectPropertyIds
...
@@ -1275,7 +1286,8 @@ enum LibvlcVideoNPObjectPropertyIds
ID_video_crop
,
ID_video_crop
,
ID_video_teletext
,
ID_video_teletext
,
ID_video_marquee
,
ID_video_marquee
,
ID_video_logo
ID_video_logo
,
ID_video_deinterlace
,
};
};
COUNTNAMES
(
LibvlcVideoNPObject
,
propertyCount
,
propertyNames
);
COUNTNAMES
(
LibvlcVideoNPObject
,
propertyCount
,
propertyNames
);
...
@@ -1363,6 +1375,12 @@ LibvlcVideoNPObject::getProperty(int index, NPVariant &result)
...
@@ -1363,6 +1375,12 @@ LibvlcVideoNPObject::getProperty(int index, NPVariant &result)
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
logoObj
),
result
);
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
logoObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
case
ID_video_deinterlace
:
{
InstantObj
<
LibvlcDeinterlaceNPObject
>
(
deintObj
);
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
deintObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
}
}
}
}
}
return
INVOKERESULT_GENERIC_ERROR
;
return
INVOKERESULT_GENERIC_ERROR
;
...
@@ -1471,8 +1489,6 @@ const NPUTF8 * const LibvlcVideoNPObject::methodNames[] =
...
@@ -1471,8 +1489,6 @@ const NPUTF8 * const LibvlcVideoNPObject::methodNames[] =
{
{
"toggleFullscreen"
,
"toggleFullscreen"
,
"toggleTeletext"
,
"toggleTeletext"
,
"deinterlaceEnable"
,
"deinterlaceDisable"
};
};
COUNTNAMES
(
LibvlcVideoNPObject
,
methodCount
,
methodNames
);
COUNTNAMES
(
LibvlcVideoNPObject
,
methodCount
,
methodNames
);
...
@@ -1480,8 +1496,6 @@ enum LibvlcVideoNPObjectMethodIds
...
@@ -1480,8 +1496,6 @@ enum LibvlcVideoNPObjectMethodIds
{
{
ID_video_togglefullscreen
,
ID_video_togglefullscreen
,
ID_video_toggleteletext
,
ID_video_toggleteletext
,
ID_video_deinterlaceenable
,
ID_video_deinterlacedisable
};
};
RuntimeNPObject
::
InvokeResult
RuntimeNPObject
::
InvokeResult
...
@@ -1522,32 +1536,6 @@ LibvlcVideoNPObject::invoke(int index, const NPVariant *args,
...
@@ -1522,32 +1536,6 @@ LibvlcVideoNPObject::invoke(int index, const NPVariant *args,
}
}
return
INVOKERESULT_NO_SUCH_METHOD
;
return
INVOKERESULT_NO_SUCH_METHOD
;
}
}
case
ID_video_deinterlacedisable
:
{
libvlc_video_set_deinterlace
(
p_md
,
0
,
""
,
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_video_deinterlaceenable
:
{
if
(
argCount
==
1
)
{
if
(
NPVARIANT_IS_STRING
(
args
[
0
]
)
)
{
/* get deinterlace mode from the user */
char
*
psz_mode
=
stringValue
(
NPVARIANT_TO_STRING
(
args
[
0
]
)
);
/* enable deinterlace filter if possible */
libvlc_video_set_deinterlace
(
p_md
,
1
,
psz_mode
,
&
ex
);
free
(
psz_mode
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
return
INVOKERESULT_NO_ERROR
;
}
else
{
return
INVOKERESULT_INVALID_VALUE
;
}
}
}
default:
default:
return
INVOKERESULT_NO_SUCH_METHOD
;
return
INVOKERESULT_NO_SUCH_METHOD
;
}
}
...
@@ -1925,6 +1913,75 @@ LibvlcLogoNPObject::invoke(int index, const NPVariant *args,
...
@@ -1925,6 +1913,75 @@ LibvlcLogoNPObject::invoke(int index, const NPVariant *args,
RETURN_ON_EXCEPTION
(
this
,
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
VOID_TO_NPVARIANT
(
result
);
VOID_TO_NPVARIANT
(
result
);
break
;
break
;
default:
return
INVOKERESULT_NO_SUCH_METHOD
;
}
return
INVOKERESULT_NO_ERROR
;
}
const
NPUTF8
*
const
LibvlcDeinterlaceNPObject
::
propertyNames
[]
=
{
};
enum
LibvlcDeinterlaceNPObjectPropertyIds
{
};
COUNTNAMES
(
LibvlcDeinterlaceNPObject
,
propertyCount
,
propertyNames
);
RuntimeNPObject
::
InvokeResult
LibvlcDeinterlaceNPObject
::
getProperty
(
int
index
,
NPVariant
&
result
)
{
return
INVOKERESULT_GENERIC_ERROR
;
}
RuntimeNPObject
::
InvokeResult
LibvlcDeinterlaceNPObject
::
setProperty
(
int
index
,
const
NPVariant
&
value
)
{
return
INVOKERESULT_GENERIC_ERROR
;
}
const
NPUTF8
*
const
LibvlcDeinterlaceNPObject
::
methodNames
[]
=
{
"enable"
,
"disable"
,
};
enum
LibvlcDeinterlaceNPObjectMethodIds
{
ID_deint_enable
,
ID_deint_disable
,
};
COUNTNAMES
(
LibvlcDeinterlaceNPObject
,
methodCount
,
methodNames
);
RuntimeNPObject
::
InvokeResult
LibvlcDeinterlaceNPObject
::
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
)
{
char
*
psz
;
if
(
!
isPluginRunning
()
)
return
INVOKERESULT_GENERIC_ERROR
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_media_player_t
*
p_md
=
getPrivate
<
VlcPlugin
>
()
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
switch
(
index
)
{
case
ID_deint_disable
:
libvlc_video_set_deinterlace
(
p_md
,
0
,
""
,
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
break
;
case
ID_deint_enable
:
if
(
argCount
!=
1
||
!
NPVARIANT_IS_STRING
(
args
[
0
]
)
)
return
INVOKERESULT_INVALID_VALUE
;
psz
=
stringValue
(
NPVARIANT_TO_STRING
(
args
[
0
]
)
);
libvlc_video_set_deinterlace
(
p_md
,
1
,
psz
,
&
ex
);
free
(
psz
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
break
;
default:
return
INVOKERESULT_NO_SUCH_METHOD
;
}
}
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
...
...
projects/mozilla/control/npolibvlc.h
View file @
f64e68a7
...
@@ -180,8 +180,8 @@ protected:
...
@@ -180,8 +180,8 @@ protected:
LibvlcVideoNPObject
(
NPP
instance
,
const
NPClass
*
aClass
)
:
LibvlcVideoNPObject
(
NPP
instance
,
const
NPClass
*
aClass
)
:
RuntimeNPObject
(
instance
,
aClass
),
RuntimeNPObject
(
instance
,
aClass
),
marqueeObj
(
NULL
),
logoObj
(
NULL
)
{
}
marqueeObj
(
NULL
),
logoObj
(
NULL
)
,
deintObj
(
NULL
)
{
}
virtual
~
LibvlcVideoNPObject
()
{
}
virtual
~
LibvlcVideoNPObject
()
;
static
const
int
propertyCount
;
static
const
int
propertyCount
;
static
const
NPUTF8
*
const
propertyNames
[];
static
const
NPUTF8
*
const
propertyNames
[];
...
@@ -197,6 +197,7 @@ protected:
...
@@ -197,6 +197,7 @@ protected:
private:
private:
NPObject
*
marqueeObj
;
NPObject
*
marqueeObj
;
NPObject
*
logoObj
;
NPObject
*
logoObj
;
NPObject
*
deintObj
;
};
};
class
LibvlcMarqueeNPObject
:
public
RuntimeNPObject
class
LibvlcMarqueeNPObject
:
public
RuntimeNPObject
...
@@ -240,3 +241,24 @@ protected:
...
@@ -240,3 +241,24 @@ protected:
InvokeResult
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
);
InvokeResult
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
);
};
};
class
LibvlcDeinterlaceNPObject
:
public
RuntimeNPObject
{
protected:
friend
class
RuntimeNPClass
<
LibvlcDeinterlaceNPObject
>
;
LibvlcDeinterlaceNPObject
(
NPP
instance
,
const
NPClass
*
aClass
)
:
RuntimeNPObject
(
instance
,
aClass
)
{
}
virtual
~
LibvlcDeinterlaceNPObject
()
{
}
static
const
int
propertyCount
;
static
const
NPUTF8
*
const
propertyNames
[];
InvokeResult
getProperty
(
int
index
,
NPVariant
&
result
);
InvokeResult
setProperty
(
int
index
,
const
NPVariant
&
value
);
static
const
int
methodCount
;
static
const
NPUTF8
*
const
methodNames
[];
InvokeResult
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
);
};
projects/mozilla/test.html
View file @
f64e68a7
...
@@ -205,9 +205,9 @@ Insert Slider widget
...
@@ -205,9 +205,9 @@ Insert Slider widget
</TR>
</TR>
<TR>
<TR>
<TD>
Deinterlacing:
<TD>
Deinterlacing:
<INPUT
type=
button
value=
"BLEND"
onClick=
'getVLC("vlc").video.deinterlace
E
nable("blend");'
>
<INPUT
type=
button
value=
"BLEND"
onClick=
'getVLC("vlc").video.deinterlace
.e
nable("blend");'
>
<INPUT
type=
button
value=
" X "
onClick=
'getVLC("vlc").video.deinterlace
E
nable("x");'
>
<INPUT
type=
button
value=
" X "
onClick=
'getVLC("vlc").video.deinterlace
.e
nable("x");'
>
<INPUT
type=
button
value=
"Disable"
onClick=
'getVLC("vlc").video.deinterlace
D
isable();'
>
<INPUT
type=
button
value=
"Disable"
onClick=
'getVLC("vlc").video.deinterlace
.d
isable();'
>
</TD>
</TD>
</TR>
</TR>
<TR>
<TR>
...
...
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