Skip to content

Commit

Permalink
for #738, add box and fullbox.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 27, 2017
1 parent 91a3989 commit 6b6ac9a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trunk/configure
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ ModuleLibIncs=(${SRS_OBJS_DIR})
MODULE_FILES=("srs_kernel_error" "srs_kernel_log" "srs_kernel_buffer"
"srs_kernel_utility" "srs_kernel_flv" "srs_kernel_codec" "srs_kernel_file"
"srs_kernel_consts" "srs_kernel_aac" "srs_kernel_mp3" "srs_kernel_ts"
"srs_kernel_stream" "srs_kernel_balance")
"srs_kernel_stream" "srs_kernel_balance" "srs_kernel_mp4")
KERNEL_INCS="src/kernel"; MODULE_DIR=${KERNEL_INCS} . auto/modules.sh
KERNEL_OBJS="${MODULE_OBJS[@]}"
#
Expand All @@ -167,7 +167,7 @@ ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
MODULE_FILES=("srs_protocol_amf0" "srs_protocol_io" "srs_rtmp_stack"
"srs_rtmp_handshake" "srs_protocol_utility" "srs_rtmp_msg_array" "srs_protocol_stream"
"srs_raw_avc" "srs_rtsp_stack" "srs_http_stack" "srs_protocol_kbps" "srs_protocol_json"
"srs_kafka_stack" "srs_kernel_mp4")
"srs_kafka_stack")
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
PROTOCOL_OBJS="${MODULE_OBJS[@]}"
#
Expand Down
20 changes: 20 additions & 0 deletions trunk/src/kernel/srs_kernel_mp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include <srs_kernel_mp4.hpp>

SrsMp4Box::SrsMp4Box(uint32_t bt)
{
size = 0;
type = bt;
}

SrsMp4Box::~SrsMp4Box()
{
}

SrsMp4FullBox::SrsMp4FullBox(uint32_t bt, uint8_t v, uint32_t f) : SrsMp4Box(bt)
{
version = v;
flags = f;
}

SrsMp4FullBox::~SrsMp4FullBox()
{
}

34 changes: 34 additions & 0 deletions trunk/src/kernel/srs_kernel_mp4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,39 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_core.hpp>

/**
* 4.2 Object Structure
* ISO_IEC_14496-12-base-format-2012.pdf, page 16
*/
class SrsMp4Box
{
public:
// if size is 1 then the actual size is in the field largesize;
// if size is 0, then this box is the last one in the file, and its contents
// extend to the end of the file (normally only used for a Media Data Box)
uint32_t size;
uint32_t type;
public:
SrsMp4Box(uint32_t bt);
virtual ~SrsMp4Box();
};

/**
* 4.2 Object Structure
* ISO_IEC_14496-12-base-format-2012.pdf, page 16
*/
class SrsMp4FullBox : public SrsMp4Box
{
public:
// an integer that specifies the version of this format of the box.
uint8_t version;
// a map of flags
uint32_t flags;
public:
SrsMp4FullBox(uint32_t bt, uint8_t v, uint32_t f);
virtual ~SrsMp4FullBox();
};


#endif

0 comments on commit 6b6ac9a

Please sign in to comment.