Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
stitchEm
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
Franco (nextime) Lanza
stitchEm
Commits
24f27633
Commit
24f27633
authored
5 years ago
by
Clement Guedez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid variable already defined in Intel MSDK
parent
eaf11d86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
mockEncoder.hpp
IO/src/rtmp/include/mockEncoder.hpp
+5
-4
mockEncoder.cpp
IO/src/rtmp/src/mockEncoder.cpp
+12
-12
No files found.
IO/src/rtmp/include/mockEncoder.hpp
View file @
24f27633
...
...
@@ -7,10 +7,11 @@
#include <memory>
#define BUFFER_SIZE 32768
#define GOT_A_NAL_CROSS_BUFFER BUFFER_SIZE + 1
#define GOT_A_NAL_INCLUDE_A_BUFFER BUFFER_SIZE + 2
#define NO_MORE_BUFFER_TO_READ BUFFER_SIZE + 3
#define ENC_BUFFER_SIZE 32768
#define GOT_A_NAL_CROSS_BUFFER ENC_BUFFER_SIZE+1
#define GOT_A_NAL_INCLUDE_A_BUFFER ENC_BUFFER_SIZE+2
#define NO_MORE_BUFFER_TO_READ ENC_BUFFER_SIZE+3
namespace
VideoStitch
{
namespace
Output
{
...
...
This diff is collapsed.
Click to expand it.
IO/src/rtmp/src/mockEncoder.cpp
View file @
24f27633
...
...
@@ -18,10 +18,10 @@ FILE *MockEncoder::fp_send;
MockEncoder
::
MockEncoder
()
{
fp_send
=
fopen
(
"C:
\\
Users
\\
nlz
\\
Videos
\\
edhec.h264"
,
"rb"
);
nalhead_pos
=
0
;
m_nFileBufSize
=
BUFFER_SIZE
;
m_pFileBuf
=
(
unsigned
char
*
)
malloc
(
BUFFER_SIZE
);
m_pFileBuf_tmp
=
(
unsigned
char
*
)
malloc
(
BUFFER_SIZE
);
std
::
memset
(
m_pFileBuf
,
0
,
BUFFER_SIZE
);
m_nFileBufSize
=
ENC_
BUFFER_SIZE
;
m_pFileBuf
=
(
unsigned
char
*
)
malloc
(
ENC_
BUFFER_SIZE
);
m_pFileBuf_tmp
=
(
unsigned
char
*
)
malloc
(
ENC_
BUFFER_SIZE
);
std
::
memset
(
m_pFileBuf
,
0
,
ENC_
BUFFER_SIZE
);
read_buffer
(
m_pFileBuf
,
m_nFileBufSize
);
}
...
...
@@ -122,7 +122,7 @@ int MockEncoder::read_buffer(uint8_t *buf, int buf_size) {
int
MockEncoder
::
readFirstNaluFromBuf
(
NaluUnit
&
nalu
)
{
unsigned
int
naltail_pos
;
std
::
memset
(
m_pFileBuf_tmp
,
0
,
BUFFER_SIZE
);
std
::
memset
(
m_pFileBuf_tmp
,
0
,
ENC_
BUFFER_SIZE
);
while
(
nalhead_pos
<
m_nFileBufSize
)
{
// search for nal header
if
(
m_pFileBuf
[
nalhead_pos
++
]
==
0x00
&&
m_pFileBuf
[
nalhead_pos
++
]
==
0x00
)
{
...
...
@@ -171,7 +171,7 @@ int MockEncoder::readOneNaluFromBuf(NaluUnit &nalu, int (*read_buffer)(uint8_t *
unsigned
int
naltail_pos
=
nalhead_pos
;
int
ret
;
int
nalustart
;
std
::
memset
(
m_pFileBuf_tmp
,
0
,
BUFFER_SIZE
);
std
::
memset
(
m_pFileBuf_tmp
,
0
,
ENC_
BUFFER_SIZE
);
nalu
.
size
=
0
;
for
(;;)
{
if
(
nalhead_pos
==
NO_MORE_BUFFER_TO_READ
)
return
FALSE
;
...
...
@@ -197,7 +197,7 @@ int MockEncoder::readOneNaluFromBuf(NaluUnit &nalu, int (*read_buffer)(uint8_t *
// again to get the rest part of this nal
if
(
nalhead_pos
==
GOT_A_NAL_CROSS_BUFFER
||
nalhead_pos
==
GOT_A_NAL_INCLUDE_A_BUFFER
)
{
nalu
.
size
=
nalu
.
size
+
naltail_pos
-
nalustart
;
if
(
nalu
.
size
>
BUFFER_SIZE
)
{
if
(
nalu
.
size
>
ENC_
BUFFER_SIZE
)
{
m_pFileBuf_tmp_old
=
m_pFileBuf_tmp
;
//// save pointer in case realloc fails
if
((
m_pFileBuf_tmp
=
(
unsigned
char
*
)
realloc
(
m_pFileBuf_tmp
,
nalu
.
size
))
==
NULL
)
{
free
(
m_pFileBuf_tmp_old
);
// free original block
...
...
@@ -226,10 +226,10 @@ int MockEncoder::readOneNaluFromBuf(NaluUnit &nalu, int (*read_buffer)(uint8_t *
if
(
naltail_pos
>=
m_nFileBufSize
&&
nalhead_pos
!=
GOT_A_NAL_CROSS_BUFFER
&&
nalhead_pos
!=
GOT_A_NAL_INCLUDE_A_BUFFER
)
{
nalu
.
size
=
BUFFER_SIZE
-
nalhead_pos
;
nalu
.
size
=
ENC_
BUFFER_SIZE
-
nalhead_pos
;
nalu
.
type
=
m_pFileBuf
[
nalhead_pos
]
&
0x1f
;
std
::
memcpy
(
m_pFileBuf_tmp
,
m_pFileBuf
+
nalhead_pos
,
nalu
.
size
);
if
((
ret
=
read_buffer
(
m_pFileBuf
,
m_nFileBufSize
))
<
BUFFER_SIZE
)
{
if
((
ret
=
read_buffer
(
m_pFileBuf
,
m_nFileBufSize
))
<
ENC_
BUFFER_SIZE
)
{
std
::
memcpy
(
m_pFileBuf_tmp
+
nalu
.
size
,
m_pFileBuf
,
ret
);
nalu
.
size
=
nalu
.
size
+
ret
;
nalu
.
data
=
m_pFileBuf_tmp
;
...
...
@@ -241,7 +241,7 @@ int MockEncoder::readOneNaluFromBuf(NaluUnit &nalu, int (*read_buffer)(uint8_t *
continue
;
}
if
(
nalhead_pos
==
GOT_A_NAL_CROSS_BUFFER
||
nalhead_pos
==
GOT_A_NAL_INCLUDE_A_BUFFER
)
{
nalu
.
size
=
BUFFER_SIZE
+
nalu
.
size
;
nalu
.
size
=
ENC_
BUFFER_SIZE
+
nalu
.
size
;
m_pFileBuf_tmp_old
=
m_pFileBuf_tmp
;
//// save pointer in case realloc fails
if
((
m_pFileBuf_tmp
=
(
unsigned
char
*
)
realloc
(
m_pFileBuf_tmp
,
nalu
.
size
))
==
NULL
)
{
...
...
@@ -249,9 +249,9 @@ int MockEncoder::readOneNaluFromBuf(NaluUnit &nalu, int (*read_buffer)(uint8_t *
return
FALSE
;
}
std
::
memcpy
(
m_pFileBuf_tmp
+
nalu
.
size
-
BUFFER_SIZE
,
m_pFileBuf
,
BUFFER_SIZE
);
std
::
memcpy
(
m_pFileBuf_tmp
+
nalu
.
size
-
ENC_BUFFER_SIZE
,
m_pFileBuf
,
ENC_
BUFFER_SIZE
);
if
((
ret
=
read_buffer
(
m_pFileBuf
,
m_nFileBufSize
))
<
BUFFER_SIZE
)
{
if
((
ret
=
read_buffer
(
m_pFileBuf
,
m_nFileBufSize
))
<
ENC_
BUFFER_SIZE
)
{
std
::
memcpy
(
m_pFileBuf_tmp
+
nalu
.
size
,
m_pFileBuf
,
ret
);
nalu
.
size
=
nalu
.
size
+
ret
;
nalu
.
data
=
m_pFileBuf_tmp
;
...
...
This diff is collapsed.
Click to expand it.
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