Internal change
PiperOrigin-RevId: 182617823
Change-Id: I960688b9b004e35f69b10a441e0bc9a140f323b5
diff --git a/example/muxing/camm_muxing.cc b/example/muxing/camm_muxing.cc
index 147a438..8038e73 100644
--- a/example/muxing/camm_muxing.cc
+++ b/example/muxing/camm_muxing.cc
@@ -56,8 +56,8 @@
3 * sizeof(float),
// 3 float position values.
3 * sizeof(float),
- // 3 floats for latitude, longitude, and altitude.
- 3 * sizeof(float),
+ // 3 doubles for latitude, longitude, and altitude.
+ 3 * sizeof(double),
// 3 doubles for time_gps_epoch, latitude, and longitude
// 1 int32 for gps_fix_type
// 7 floats for altitude, horizontal_accuracy, vertical_accuracy,
@@ -85,13 +85,13 @@
static int WriteSampleCammBytes(void *bytes, int packet_number) {
uint32_t angle_x, angle_y, angle_z, gyro_x, gyro_y, gyro_z, acceleration_x,
acceleration_y, acceleration_z, position_x, position_y, position_z,
- latitude32, longitude32, gps_fix_type, horizontal_accuracy_meters,
+ gps_fix_type, horizontal_accuracy_meters,
vertical_accuracy_meters, vertical_east_velocity_mps,
vertical_north_velocity_mps, speed_accuracy_mps, altitude,
magnetic_field_x, magnetic_field_y, magnetic_field_z,
pixel_exposure_nanoseconds, rolling_shutter_skew_time,
vertical_up_velocity_mps;
- uint64_t latitude64, longitude64, time_gps_epoch;
+ uint64_t latitude64, longitude64, altitude64, time_gps_epoch;
memset(bytes, 0, BYTE_BUFFER_SIZE);
uint16_t *camm_data = reinterpret_cast<uint16_t *>(bytes);
uint16_t packet_type = packet_number % 8;
@@ -139,12 +139,12 @@
memcpy(camm_data + 4, &position_z, 4);
break;
case 5:
- latitude32 = float_to_bytes(37.454356 + .001 * packet_number);
- longitude32 = float_to_bytes(-122.167477 + 0.001 * packet_number);
- altitude = 0;
- memcpy(camm_data, &latitude32, 4);
- memcpy(camm_data + 2, &longitude32, 4);
- memcpy(camm_data + 4, &altitude, 4);
+ latitude64 = double_to_bytes(37.454356 + .001 * packet_number);
+ longitude64 = double_to_bytes(-122.167477 + 0.001 * packet_number);
+ altitude64 = 0;
+ memcpy(camm_data, &latitude64, sizeof(double));
+ memcpy(camm_data + 4, &longitude64, sizeof(double));
+ memcpy(camm_data + 8, &altitude64, sizeof(double));
break;
case 6:
time_gps_epoch = double_to_bytes(1500507374.825 + packet_number);
@@ -327,7 +327,7 @@
#endif
VerifyProgramArgs(argc, argv);
- MP4FileHandle handle = MP4Create(argv[3], /* flags */ 0);
+ MP4FileHandle handle = MP4Create(argv[3], MP4_CREATE_64BIT_DATA);
int num_frames = std::stoi(argv[2]);
int video_track_id = AddVideoTrack(handle, num_frames);
int camm_track_id = AddCammTrack(handle);