MMCAM_CAMERA_HDR_CAPTURE, &sc->info_image->hdr_capture_mode,
MMCAM_IMAGE_ENCODER, &codectype,
MMCAM_IMAGE_ENCODER_QUALITY, &capture_jpg_quality,
- MMCAM_DISPLAY_SHM_SOCKET_PATH, &socket_path, &socket_path_len,
+ MMCAM_DISPLAY_SOCKET_PATH, &socket_path, &socket_path_len,
MMCAM_DISPLAY_SURFACE, &display_surface_type,
NULL);
if (err != MM_ERROR_NONE) {
_MMCAMCORDER_ELEMENT_MAKE(sc, sc->element, _MMCAMCORDER_VIDEOSINK_SINK, videosink_name, "ipc_sink", element_list, err);
err = mm_camcorder_get_attributes(handle, &err_name,
- MMCAM_DISPLAY_SHM_SOCKET_PATH, &socket_path, &socket_path_len,
+ MMCAM_DISPLAY_SOCKET_PATH, &socket_path, &socket_path_len,
NULL);
if (err != MM_ERROR_NONE) {
_mmcam_dbg_warn("Get socket path failed 0x%x", err);
element_list = NULL;
}
- if (video_caps) {
- gst_caps_unref(video_caps);
- video_caps = NULL;
- }
-
_mmcam_dbg_log("done");
return MM_ERROR_NONE;
element_list = NULL;
}
- if (video_caps) {
- gst_caps_unref(video_caps);
- video_caps = NULL;
- }
-
return err;
}
structure = gst_caps_get_structure( caps, 0 );
gst_structure_get_int(structure, "width", &(stream.width));
gst_structure_get_int(structure, "height", &(stream.height));
- string_format = gst_structure_get_string(structure, "format");
- if (string_format == NULL) {
- gst_caps_unref(caps);
- caps = NULL;
- _mmcam_dbg_warn("get string error!!");
- return GST_PAD_PROBE_OK;
+ if (sc->info_image->preview_format == MM_PIXEL_FORMAT_ENCODED_H264) {
+ stream.format = MM_PIXEL_FORMAT_ENCODED_H264;
+ } else {
+ string_format = gst_structure_get_string(structure, "format");
+ if (string_format == NULL) {
+ gst_caps_unref(caps);
+ caps = NULL;
+ _mmcam_dbg_warn("get string error!!");
+ return GST_PAD_PROBE_OK;
+ }
+ fourcc = _mmcamcorder_convert_fourcc_string_to_value(string_format);
+ stream.format = _mmcamcorder_get_pixtype(fourcc);
}
-
- fourcc = _mmcamcorder_convert_fourcc_string_to_value(string_format);
- stream.format = _mmcamcorder_get_pixtype(fourcc);
gst_caps_unref(caps);
caps = NULL;
stream.data_type = MM_CAM_STREAM_DATA_YUV422;
stream.data.yuv422.yuv = mapinfo.data;
stream.data.yuv422.length_yuv = stream.length_total;
+ } else if (stream.format == MM_PIXEL_FORMAT_ENCODED_H264) {
+ stream.data_type = MM_CAM_STREAM_DATA_ENCODED;
+ stream.data.encoded.data = mapinfo.data;
+ stream.data.encoded.length_data = stream.length_total;
+ _mmcam_dbg_log("H264[num_planes:%d] [0]p:0x%x,size:%d",
+ fourcc, fourcc>>8, fourcc>>16, fourcc>>24, stream.num_planes,
+ stream.data.encoded.data, stream.data.encoded.length_data);
} else {
stream.data_type = MM_CAM_STREAM_DATA_YUV420;
stream.data.yuv420.yuv = mapinfo.data;
}
/* Check compatibility between audio codec and file format */
- if (audio_codec >= MM_AUDIO_CODEC_INVALID && audio_codec < MM_AUDIO_CODEC_NUM &&
- file_format >= MM_FILE_FORMAT_INVALID && file_format < MM_FILE_FORMAT_NUM) {
+ if (audio_codec > MM_AUDIO_CODEC_INVALID && audio_codec < MM_AUDIO_CODEC_NUM &&
+ file_format > MM_FILE_FORMAT_INVALID && file_format < MM_FILE_FORMAT_NUM) {
if (audiocodec_fileformat_compatibility_table[audio_codec][file_format] == 0) {
_mmcam_dbg_err("Audio codec[%d] and file format[%d] compatibility FAILED.",
audio_codec, file_format);
}
/* Check compatibility between audio codec and file format */
- if (video_codec >= MM_VIDEO_CODEC_INVALID && video_codec < MM_VIDEO_CODEC_NUM &&
- file_format >= MM_FILE_FORMAT_INVALID && file_format < MM_FILE_FORMAT_NUM) {
+ if (video_codec > MM_VIDEO_CODEC_INVALID && video_codec < MM_VIDEO_CODEC_NUM &&
+ file_format > MM_FILE_FORMAT_INVALID && file_format < MM_FILE_FORMAT_NUM) {
if (videocodec_fileformat_compatibility_table[video_codec][file_format] == 0) {
_mmcam_dbg_err("Video codec[%d] and file format[%d] compatibility FAILED.",
video_codec, file_format);
structure = gst_caps_get_structure(caps, 0);
if (structure) {
+ const gchar *format_string = NULL;
int caps_width = 0;
int caps_height = 0;
int caps_fps = 0;
int caps_rotate = 0;
- caps_fourcc = _mmcamcorder_convert_fourcc_string_to_value(gst_structure_get_string(structure, "format"));
+ format_string = gst_structure_get_string(structure, "format");
+ if (format_string) {
+ caps_fourcc = _mmcamcorder_convert_fourcc_string_to_value(format_string);
+ }
gst_structure_get_int(structure, "width", &caps_width);
gst_structure_get_int(structure, "height", &caps_height);
gst_structure_get_int(structure, "fps", &caps_fps);