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
7f92a65e
Commit
7f92a65e
authored
Dec 20, 2010
by
Rune Botten
Committed by
Pierre d'Herbemont
Dec 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for getting stats from VLCMedia
Signed-off-by:
Pierre d'Herbemont
<
pdherbemont@free.fr
>
parent
fbd6f7c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Headers/Public/VLCMedia.h
+9
-3
projects/macosx/framework/Sources/VLCMedia.m
projects/macosx/framework/Sources/VLCMedia.m
+29
-1
No files found.
projects/macosx/framework/Headers/Public/VLCMedia.h
View file @
7f92a65e
...
...
@@ -332,15 +332,21 @@ extern NSString *VLCMediaTracksInformationTypeUnknown;
*/
-
(
void
)
parse
;
/**
************************************************************************
/**
* Add options to the media, that will be used to determine how
* VLCMediaPlayer will read the media. This allow to use VLC advanced
* reading/streaming options in a per-media basis
*
* The options are detailed in vlc --long-help, for instance "--sout-all"
* And on the web: http://wiki.videolan.org/VLC_command-line_help
**************************************************************************/
*/
-
(
void
)
addOptions
:(
NSDictionary
*
)
options
;
/**
* Getter for statistics information
* Returns a NSDictionary with NSNumbers for values.
*
*/
-
(
NSDictionary
*
)
stats
;
@end
projects/macosx/framework/Sources/VLCMedia.m
View file @
7f92a65e
...
...
@@ -338,6 +338,34 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)
}
}
-
(
NSDictionary
*
)
stats
{
if
(
!
p_md
)
return
NULL
;
NSMutableDictionary
*
d
=
[
NSMutableDictionary
dictionary
];
libvlc_media_stats_t
p_stats
;
libvlc_media_get_stats
(
p_md
,
&
p_stats
);
[
d
setObject
:[
NSNumber
numberWithFloat
:
p_stats
.
f_demux_bitrate
]
forKey
:
@"demuxBitrate"
];
[
d
setObject
:[
NSNumber
numberWithFloat
:
p_stats
.
f_input_bitrate
]
forKey
:
@"inputBitrate"
];
[
d
setObject
:[
NSNumber
numberWithFloat
:
p_stats
.
f_send_bitrate
]
forKey
:
@"sendBitrate"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_decoded_audio
]
forKey
:
@"decodedAudio"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_decoded_video
]
forKey
:
@"decodedVideo"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_demux_corrupted
]
forKey
:
@"demuxCorrupted"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_demux_discontinuity
]
forKey
:
@"demuxDiscontinuity"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_demux_read_bytes
]
forKey
:
@"demuxReadBytes"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_displayed_pictures
]
forKey
:
@"displayedPictures"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_lost_abuffers
]
forKey
:
@"lostAbuffers"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_lost_pictures
]
forKey
:
@"lostPictures"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_played_abuffers
]
forKey
:
@"playedAbuffers"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_read_bytes
]
forKey
:
@"readBytes"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_sent_bytes
]
forKey
:
@"sentBytes"
];
[
d
setObject
:[
NSNumber
numberWithInt
:
p_stats
.
i_sent_packets
]
forKey
:
@"sentPackets"
];
return
d
;
}
NSString
*
VLCMediaTracksInformationCodec
=
@"codec"
;
// NSNumber
NSString
*
VLCMediaTracksInformationId
=
@"id"
;
// NSNumber
NSString
*
VLCMediaTracksInformationType
=
@"type"
;
// NSString
...
...
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