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
c030c882
Commit
c030c882
authored
Mar 09, 2012
by
Christopher Mueller
Committed by
Hugo Beauzée-Luyssen
Mar 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: added byte count methods to chunk
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
121f1710
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
23 deletions
+57
-23
modules/stream_filter/dash/http/Chunk.cpp
modules/stream_filter/dash/http/Chunk.cpp
+42
-16
modules/stream_filter/dash/http/Chunk.h
modules/stream_filter/dash/http/Chunk.h
+15
-7
No files found.
modules/stream_filter/dash/http/Chunk.cpp
View file @
c030c882
...
@@ -34,7 +34,9 @@ Chunk::Chunk () :
...
@@ -34,7 +34,9 @@ Chunk::Chunk () :
endByte
(
0
),
endByte
(
0
),
hasByteRange
(
false
),
hasByteRange
(
false
),
port
(
0
),
port
(
0
),
isHostname
(
false
)
isHostname
(
false
),
length
(
0
),
bytesRead
(
0
)
{
{
}
}
...
@@ -114,3 +116,27 @@ int Chunk::getPort () const
...
@@ -114,3 +116,27 @@ int Chunk::getPort () const
{
{
return
this
->
port
;
return
this
->
port
;
}
}
uint64_t
Chunk
::
getLength
()
const
{
return
this
->
length
;
}
void
Chunk
::
setLength
(
uint64_t
length
)
{
this
->
length
=
length
;
}
uint64_t
Chunk
::
getBytesRead
()
const
{
return
this
->
bytesRead
;
}
void
Chunk
::
setBytesRead
(
uint64_t
bytes
)
{
this
->
bytesRead
=
bytes
;
}
uint64_t
Chunk
::
getBytesToRead
()
const
{
return
this
->
length
-
this
->
bytesRead
;
}
size_t
Chunk
::
getPercentDownloaded
()
const
{
return
(
size_t
)(((
float
)
this
->
bytesRead
/
this
->
length
)
*
100
);
}
modules/stream_filter/dash/http/Chunk.h
View file @
c030c882
...
@@ -48,7 +48,13 @@ namespace dash
...
@@ -48,7 +48,13 @@ namespace dash
const
std
::
string
&
getHostname
()
const
;
const
std
::
string
&
getHostname
()
const
;
const
std
::
string
&
getPath
()
const
;
const
std
::
string
&
getPath
()
const
;
int
getPort
()
const
;
int
getPort
()
const
;
uint64_t
getLength
()
const
;
uint64_t
getBytesRead
()
const
;
uint64_t
getBytesToRead
()
const
;
size_t
getPercentDownloaded
()
const
;
void
setBytesRead
(
uint64_t
bytes
);
void
setLength
(
uint64_t
length
);
void
setEndByte
(
int
endByte
);
void
setEndByte
(
int
endByte
);
void
setStartByte
(
int
startByte
);
void
setStartByte
(
int
startByte
);
void
setUrl
(
const
std
::
string
&
url
);
void
setUrl
(
const
std
::
string
&
url
);
...
@@ -69,6 +75,8 @@ namespace dash
...
@@ -69,6 +75,8 @@ namespace dash
int
bitrate
;
int
bitrate
;
int
port
;
int
port
;
bool
isHostname
;
bool
isHostname
;
size_t
length
;
uint64_t
bytesRead
;
};
};
}
}
}
}
...
...
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