- /*set the camera control to create the GOP so that video record will get a new key frame*/
- if (sc->info_image->preview_format == MM_PIXEL_FORMAT_ENCODED_H264 &&
- GST_IS_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst)) {
- CameraControl = GST_CAMERA_CONTROL(sc->element[_MMCAMCORDER_VIDEOSRC_SRC].gst);
- controls = gst_camera_control_list_channels(CameraControl);
- if (controls != NULL) {
- for (item = controls ; item && item->data ; item = item->next) {
- CameraControlChannel = item->data;
- _mmcam_dbg_log("CameraControlChannel->label %s", CameraControlChannel->label);
- if (!strcmp(CameraControlChannel->label, "new-gop")) {
- /* gst_camera_control_set_value(CameraControl, CameraControlChannel, 1); */
- break;
- }
- }
-
- if (item == NULL)
- _mmcam_dbg_warn("failed to find new-gop control channel");
- }
- } else {
- _mmcam_dbg_warn("Can't cast Video source into camera control or not H264 prevew format[%d]",
- sc->info_image->preview_format);
+ /*set the GOP so that video record will get a new key frame*/
+ if (sc->info_image->preview_format == MM_PIXEL_FORMAT_ENCODED_H264) {
+ if (mm_camcorder_get_attributes(handle, NULL,
+ MMCAM_ENCODED_PREVIEW_GOP_INTERVAL, &gop_interval, NULL) == MM_ERROR_NONE)
+ _mmcamcorder_set_encoded_preview_gop_interval(handle, gop_interval);
+ else
+ _mmcam_dbg_err("get gop interval failed");