Commit d925b4c1 authored by Ronan's avatar Ronan

fix(CMakeLists.txt): fix compilation with no video

parent 9c80f8cc
......@@ -112,7 +112,7 @@ if(ENABLE_SHARED)
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.mediastreamerbase
MACOSX_FRAMEWORK_INFO_PLIST Info_base.plist.in
PUBLIC_HEADER "${MEDIASTREAMER2_HEADER_FILES}"
)
)
endif()
if(NOT ANDROID)
# Do not version shared library on Android
......@@ -174,8 +174,6 @@ set(VOIP_SOURCE_FILES_C
utils/g722.h
utils/g722_decode.c
utils/g722_encode.c
utils/h264utils.h
utils/h264utils.c
utils/kiss_fft.c
utils/kiss_fft.h
utils/kiss_fftr.c
......@@ -286,6 +284,8 @@ endif()
if(ENABLE_VIDEO)
list(APPEND VOIP_SOURCE_FILES_C
utils/bits_rw.c
utils/h264utils.c
utils/h264utils.h
videofilters/extdisplay.c
videofilters/mire.c
videofilters/nowebcam.c
......@@ -293,15 +293,15 @@ if(ENABLE_VIDEO)
videofilters/sizeconv.c
voip/layouts.c
voip/layouts.h
voip/msvideo.c
voip/msvideo_neon.c
voip/msvideo_neon.h
voip/msvideo.c
voip/nowebcam.h
voip/rfc2429.h
voip/rfc3984.c
voip/video_preset_high_fps.c
voip/videostarter.c
voip/videostream.c
voip/video_preset_high_fps.c
)
if(FFMPEG_FOUND AND NOT TURBOJPEG_FOUND)
list(APPEND VOIP_SOURCE_FILES_C
......@@ -683,7 +683,7 @@ if(ENABLE_SHARED)
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.mediastreamervoip
MACOSX_FRAMEWORK_INFO_PLIST Info_voip.plist.in
PUBLIC_HEADER "${MEDIASTREAMER2_HEADER_FILES}"
)
)
endif()
if(NOT ANDROID)
# Do not version shared library on Android
......
......@@ -23,15 +23,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#undef bool_t
#define bool_t ms_bool_t
#include "mediastreamer2/msfilter.h"
#include "mediastreamer2/msvideo.h"
#include "mediastreamer2/rfc3984.h"
#include "mediastreamer2/msticker.h"
#include "waveheader.h"
#include "mediastreamer2/formats.h"
#include "vp8rtpfmt.h"
#include "mkv_reader.h"
#include "h264utils.h"
#ifdef VIDEO_ENABLED
#include "mediastreamer2/msvideo.h"
#include "vp8rtpfmt.h"
#include "mediastreamer2/rfc3984.h"
#include "h264utils.h"
#endif // ifdef VIDEO_ENABLED
#undef bool_t
#define bool_t ambigous use ms_bool_t or matroska_bool_t
......@@ -66,6 +71,8 @@ typedef struct {
ModuleIsKeyFrameFunc is_key_frame;
} ModuleDesc;
#ifdef VIDEO_ENABLED
/*********************************************************************************************
* h264 module *
*********************************************************************************************/
......@@ -334,24 +341,24 @@ static void nalus_to_frame(mblk_t *buffer, mblk_t **frame, bctbx_list_t **spsLis
curNalu = curNalu->b_cont;
buff->b_cont = NULL;
switch(type) {
case MSH264NaluTypeSPS:
*spsList = bctbx_list_append(*spsList, copymsg(buff));
break;
case MSH264NaluTypePPS:
*ppsList = bctbx_list_append(*ppsList, copymsg(buff));
break;
case MSH264NaluTypeIDR:
*isKeyFrame = TRUE;
break;
default:
break;
}
bufferSize = htonl((uint32_t)msgdsize(buff));
size = allocb(4, 0);
memcpy(size->b_wptr, &bufferSize, sizeof(bufferSize));
......@@ -376,14 +383,14 @@ static mblk_t *h264_module_processing(void *data, mblk_t *nalus, ms_bool_t *isKe
H264Module *obj = (H264Module *)data;
mblk_t *frame;
bctbx_list_t *spsList, *ppsList;
*codecPrivateData = NULL;
*codecPrivateSize = 0;
nalus_to_frame(nalus, &frame, &spsList, &ppsList, isKeyFrame);
if(spsList != NULL || ppsList != NULL) {
bctbx_list_t *it;
H264Private *newCodecPrivate;
ms_message("MKVRecorder: H264 SPS [%p] or PPS [%p] received", spsList, ppsList);
if (obj->lastCodecPrivate != NULL) {
newCodecPrivate = H264Private_clone(obj->lastCodecPrivate);
......@@ -495,7 +502,6 @@ static void h264_module_load_private_data(void *o, const uint8_t *data, size_t s
}
/* h264 module description */
#ifdef _MSC_VER
static const ModuleDesc h264_module_desc = {
"H264",
"V_MPEG4/ISO/AVC",
......@@ -509,21 +515,6 @@ static const ModuleDesc h264_module_desc = {
h264_module_load_private_data,
h264_is_key_frame
};
#else
static const ModuleDesc h264_module_desc = {
.rfcName = "H264",
.codecId = "V_MPEG4/ISO/AVC",
.new_module = h264_module_new,
.free_module = h264_module_free,
.set = NULL,
.preprocess = h264_module_preprocessing,
.process = h264_module_processing,
.reverse = h264_module_reverse,
.get_private_data = h264_module_get_private_data,
.load_private_data = h264_module_load_private_data,
.is_key_frame = h264_is_key_frame
};
#endif
/*********************************************************************************************
* VP8 module *
......@@ -596,7 +587,6 @@ static ms_bool_t vp8_module_is_keyframe(const mblk_t *frame) {
}
/* VP8 module description */
#ifdef _MSC_VER
static const ModuleDesc vp8_module_desc = {
"VP8",
"V_VP8",
......@@ -610,24 +600,11 @@ static const ModuleDesc vp8_module_desc = {
NULL,
vp8_module_is_keyframe
};
#else
static const ModuleDesc vp8_module_desc = {
.rfcName = "VP8",
.codecId = "V_VP8",
.new_module = vp8_module_new,
.free_module = vp8_module_free,
.set = NULL,
.preprocess = vp8_module_preprocess,
.process = vp8_module_process,
.reverse = vp8_module_reverse,
.get_private_data = NULL,
.load_private_data = NULL,
.is_key_frame = vp8_module_is_keyframe
};
#endif
#endif /* HAVE_VPX */
#endif // ifdef VIDEO_ENABLED
/*********************************************************************************************
* µLaw module *
*********************************************************************************************/
......@@ -818,21 +795,14 @@ static const ModuleDesc opus_module_desc = {
/*********************************************************************************************
* Modules list *
*********************************************************************************************/
#if 0
typedef enum {
NONE_ID,
H264_MOD_ID,
VP8_MOD_ID,
MU_LAW_MOD_ID,
OPUS_MOD_ID
} ModuleId;
#endif
static const ModuleDesc *moduleDescs[] = {
#ifdef VIDEO_ENABLED
&h264_module_desc,
#ifdef HAVE_VPX
&vp8_module_desc,
#endif /* HAVE_VPX */
#endif // ifdef VIDEO_ENABLED
&mu_law_module_desc,
&opus_module_desc,
NULL
......@@ -987,9 +957,9 @@ static void loadModules(nodemodule *modules) {
}
typedef enum {
MKV_OPEN_CREATE,
MKV_OPEN_APPEND,
MKV_OPEN_RO
MKV_OPEN_CREATE,
MKV_OPEN_APPEND,
MKV_OPEN_RO
} MatroskaOpenMode;
typedef struct {
......@@ -1137,7 +1107,7 @@ static ms_bool_t matroska_load_file(Matroska *obj) {
}
/* Create an empty MetaSeek table if no has been found and create
the missing entries */
the missing entries */
if(obj->metaSeek == NULL) obj->metaSeek = (ebml_master *)EBML_MasterAddElt(obj->segment, &MATROSKA_ContextSeekHead, FALSE);
if(obj->infoMeta == NULL) {
obj->infoMeta = (matroska_seekpoint *)EBML_MasterAddElt(obj->metaSeek, &MATROSKA_ContextSeek, TRUE);
......@@ -1413,9 +1383,11 @@ static int matroska_close_segment(Matroska *obj) {
static ebml_master *matroska_find_track_entry(const Matroska *obj, int trackNum) {
ebml_element *trackEntry = NULL;
for(trackEntry = EBML_MasterChildren(obj->tracks);
trackEntry != NULL && EBML_IntegerValue((ebml_integer *)EBML_MasterGetChild((ebml_master *)trackEntry, &MATROSKA_ContextTrackNumber)) != trackNum;
trackEntry = EBML_MasterNext(trackEntry));
for(
trackEntry = EBML_MasterChildren(obj->tracks);
trackEntry != NULL && EBML_IntegerValue((ebml_integer *)EBML_MasterGetChild((ebml_master *)trackEntry, &MATROSKA_ContextTrackNumber)) != trackNum;
trackEntry = EBML_MasterNext(trackEntry)
);
return (ebml_master *)trackEntry;
}
......@@ -1478,9 +1450,11 @@ static timecode_t matroska_current_cluster_timecode(const Matroska *obj) {
static ebml_master *matroska_find_track(const Matroska *obj, int trackNum) {
ebml_element *elt = NULL;
for(elt = EBML_MasterChildren(obj->tracks);
elt != NULL && EBML_IntegerValue((ebml_integer *)EBML_MasterFindChild(elt, &MATROSKA_ContextTrackNumber)) != trackNum;
elt = EBML_MasterNext(elt));
for(
elt = EBML_MasterChildren(obj->tracks);
elt != NULL && EBML_IntegerValue((ebml_integer *)EBML_MasterFindChild(elt, &MATROSKA_ContextTrackNumber)) != trackNum;
elt = EBML_MasterNext(elt)
);
return (ebml_master *)elt;
}
......@@ -1919,7 +1893,7 @@ static matroska_block *write_frame(MKVRecorder *obj, mblk_t *buffer, uint16_t pi
block = matroska_write_block(&obj->file, &m_frame, pin + 1, isKeyFrame, isVisible, codecPrivateData, codecPrivateSize);
freemsg(frame);
if (codecPrivateData != NULL) bctbx_free(codecPrivateData);
return block;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment