Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.WithCustomProto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.WithCustomProto
Commits
2667dca3
Commit
2667dca3
authored
Apr 14, 2022
by
NzSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ebf78f4c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
ioctx.cc
src/ioctx.cc
+0
-9
ioctx.h
src/ioctx.h
+2
-1
proto.h
src/proto/proto.h
+3
-3
No files found.
src/ioctx.cc
View file @
2667dca3
...
...
@@ -35,15 +35,6 @@ bool InOutCtx::isReady() noexcept {
// InCtx //
///////////////////////////////////////////////////////////////////////////////
InCtx
::
InCtx
(
std
::
string
path
,
CustomProto
proto
)
:
InOutCtx
(
path
,
proto
)
{
// FIXME: Build AVIOContex for custom proto
AVIOContext
*
customIO
=
nullptr
;
fmt
=
Utils
::
makeInAVFormat
(
path
,
customIO
);
}
void
InCtx
::
readFrame
(
AVPacket
*
packet
)
{
if
(
av_read_frame
(
fmt
.
get
(),
packet
)
<
0
)
throw
END_OF_FILE
();
...
...
src/ioctx.h
View file @
2667dca3
...
...
@@ -41,7 +41,7 @@ enum IOCTX_ERROR {
using
StreamPrediction
=
std
::
function
<
bool
(
AVStream
*
)
>
;
template
<
typename
T
>
class
InOutCtx
{
public
:
InOutCtx
(
std
::
string
path
,
bool
isCustom
)
:
...
...
@@ -52,6 +52,7 @@ public:
protected
:
Utils
::
AVFormatContextShared
fmt
;
std
::
string
path
;
bool
isCustomIO
;
};
...
...
src/proto/proto.h
View file @
2667dca3
...
...
@@ -29,15 +29,15 @@ public:
name
(
name
),
flag
(
flag
),
io
(
nullptr
),
priv
(
priv
)
{}
int
read_packet
(
void
*
priv
,
uint8_t
*
buf
,
int
bufSize
)
{
static_cast
<
T
*>
(
this
)
->
read_packet_internal
(
priv
,
buf
,
bufSize
);
return
static_cast
<
T
*>
(
this
)
->
read_packet_internal
(
priv
,
buf
,
bufSize
);
}
int
write_packet
(
void
*
priv
,
uint8_t
*
buf
,
int
bufSize
)
{
static_cast
<
T
*>
(
this
)
->
write_packet_internal
(
priv
,
buf
,
bufSize
);
return
static_cast
<
T
*>
(
this
)
->
write_packet_internal
(
priv
,
buf
,
bufSize
);
}
int64_t
seek_packet
(
void
*
opaque
,
int64_t
offset
,
int
whence
)
{
static_cast
<
T
*>
(
this
)
->
seek_packet_internal
(
opaque
,
offset
,
whence
);
return
static_cast
<
T
*>
(
this
)
->
seek_packet_internal
(
opaque
,
offset
,
whence
);
}
AVIOContext
*
to_avioctx
()
noexcept
{
...
...
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