Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4a686e86
Commit
4a686e86
authored
May 27, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activex plugin: Move new additions to exception_bridge.
parent
19db7620
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
70 deletions
+35
-70
projects/activex/vlccontrol2.cpp
projects/activex/vlccontrol2.cpp
+34
-70
projects/activex/vlccontrol2.h
projects/activex/vlccontrol2.h
+1
-0
No files found.
projects/activex/vlccontrol2.cpp
View file @
4a686e86
...
...
@@ -57,6 +57,7 @@ EMIT_EXCEPTION_BRIDGE( VLCLog )
EMIT_EXCEPTION_BRIDGE
(
VLCPlaylistItems
)
EMIT_EXCEPTION_BRIDGE
(
VLCPlaylist
)
EMIT_EXCEPTION_BRIDGE
(
VLCVideo
)
EMIT_EXCEPTION_BRIDGE
(
VLCSubtitle
)
#undef EMIT_EXCEPTION_BRIDGE
...
...
@@ -251,14 +252,7 @@ STDMETHODIMP VLCAudio::get_count(long* trackNumber)
libvlc_exception_init
(
&
ex
);
// get the number of audio track available and return it
*
trackNumber
=
libvlc_audio_get_track_count
(
p_md
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
NOERROR
;
hr
=
exception_bridge
(
&
ex
);
}
return
hr
;
};
...
...
@@ -282,21 +276,15 @@ STDMETHODIMP VLCAudio::description(long trackID, BSTR* name)
// get tracks description
p_trackDesc
=
libvlc_audio_get_track_description
(
p_md
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
hr
=
exception_bridge
(
&
ex
);
if
(
FAILED
(
hr
)
)
return
hr
;
//get the number of available track
i_limit
=
libvlc_audio_get_track_count
(
p_md
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
hr
=
exception_bridge
(
&
ex
);
if
(
FAILED
(
hr
)
)
return
hr
;
// check if the number given is a good one
if
(
(
trackID
>
(
i_limit
-
1
)
)
||
(
trackID
<
0
)
)
...
...
@@ -548,14 +536,12 @@ STDMETHODIMP VLCInput::get_state(long* state)
libvlc_exception_init
(
&
ex
);
*
state
=
libvlc_media_player_get_state
(
p_md
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
return
NOERROR
;
}
libvlc_exception_clear
(
&
ex
);
// don't fail, just return the idle state
*
state
=
0
;
return
NOERROR
;
libvlc_exception_clear
(
&
ex
);
}
}
return
hr
;
};
...
...
@@ -1819,13 +1805,7 @@ STDMETHODIMP VLCSubtitle::get_track(long* spu)
libvlc_exception_init
(
&
ex
);
*
spu
=
libvlc_video_get_spu
(
p_md
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
return
NOERROR
;
}
_p_instance
->
setErrorInfo
(
IID_IVLCSubtitle
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
hr
=
exception_bridge
(
&
ex
);
}
return
hr
;
};
...
...
@@ -1840,13 +1820,7 @@ STDMETHODIMP VLCSubtitle::put_track(long spu)
libvlc_exception_init
(
&
ex
);
libvlc_video_set_spu
(
p_md
,
spu
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCSubtitle
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
NOERROR
;
hr
=
exception_bridge
(
&
ex
);
}
return
hr
;
};
...
...
@@ -1864,13 +1838,7 @@ STDMETHODIMP VLCSubtitle::get_count(long* spuNumber)
libvlc_exception_init
(
&
ex
);
// get the number of video subtitle available and return it
*
spuNumber
=
libvlc_video_get_spu_count
(
p_md
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCSubtitle
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
NOERROR
;
hr
=
exception_bridge
(
&
ex
);
}
return
hr
;
};
...
...
@@ -1894,21 +1862,15 @@ STDMETHODIMP VLCSubtitle::description(long nameID, BSTR* name)
// get subtitles description
p_spuDesc
=
libvlc_video_get_spu_description
(
p_md
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCSubtitle
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
hr
=
exception_bridge
(
&
ex
);
if
(
FAILED
(
hr
)
)
return
hr
;
// get the number of available subtitle
i_limit
=
libvlc_video_get_spu_count
(
p_md
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCSubtitle
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
hr
=
exception_bridge
(
&
ex
);
if
(
FAILED
(
hr
)
)
return
hr
;
// check if the number given is a good one
if
(
(
nameID
>
(
i_limit
-
1
)
)
||
(
nameID
<
0
)
)
...
...
@@ -2315,22 +2277,27 @@ STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
char
*
psz_filepath
=
path
;
/* first convert to unicode using current code page */
WCHAR
wpath
[
MAX_PATH
+
1
];
if
(
0
==
MultiByteToWideChar
(
CP_ACP
,
0
,
filepath
,
-
1
,
wpath
,
sizeof
(
wpath
)
/
sizeof
(
WCHAR
))
)
if
(
0
==
MultiByteToWideChar
(
CP_ACP
,
0
,
filepath
,
-
1
,
wpath
,
sizeof
(
wpath
)
/
sizeof
(
WCHAR
))
)
return
E_FAIL
;
#endif
/* convert to UTF8 */
pathlen
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
wpath
,
-
1
,
psz_filepath
,
sizeof
(
path
),
NULL
,
NULL
);
// fail if path is 0 or too short (i.e pathlen is the same as storage size)
pathlen
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
wpath
,
-
1
,
psz_filepath
,
sizeof
(
path
),
NULL
,
NULL
);
// fail if path is 0 or too short (i.e pathlen is the same as
// storage size)
if
(
(
0
==
pathlen
)
||
(
sizeof
(
path
)
==
pathlen
)
)
return
E_FAIL
;
/* take snapshot into file */
libvlc_video_take_snapshot
(
p_md
,
psz_filepath
,
0
,
0
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
hr
=
exception_bridge
(
&
ex
);
if
(
SUCCEEDED
(
hr
)
)
{
hr
=
E_FAIL
;
/* open snapshot file */
HANDLE
snapPic
=
LoadImage
(
NULL
,
filepath
,
IMAGE_BITMAP
,
0
,
0
,
LR_CREATEDIBSECTION
|
LR_LOADFROMFILE
);
HANDLE
snapPic
=
LoadImage
(
NULL
,
filepath
,
IMAGE_BITMAP
,
0
,
0
,
LR_CREATEDIBSECTION
|
LR_LOADFROMFILE
);
if
(
snapPic
)
{
PICTDESC
snapDesc
;
...
...
@@ -2340,7 +2307,8 @@ STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
snapDesc
.
bmp
.
hbitmap
=
(
HBITMAP
)
snapPic
;
snapDesc
.
bmp
.
hpal
=
NULL
;
hr
=
OleCreatePictureIndirect
(
&
snapDesc
,
IID_IPictureDisp
,
TRUE
,
(
LPVOID
*
)
picture
);
hr
=
OleCreatePictureIndirect
(
&
snapDesc
,
IID_IPictureDisp
,
TRUE
,
(
LPVOID
*
)
picture
);
if
(
FAILED
(
hr
)
)
{
*
picture
=
NULL
;
...
...
@@ -2348,11 +2316,7 @@ STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
}
}
DeleteFile
(
filepath
);
return
hr
;
}
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
hr
;
};
...
...
projects/activex/vlccontrol2.h
View file @
4a686e86
...
...
@@ -532,6 +532,7 @@ public:
protected:
HRESULT
loadTypeInfo
();
HRESULT
exception_bridge
(
libvlc_exception_t
*
ex
);
private:
VLCPlugin
*
_p_instance
;
...
...
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