p/s proxy icon, rework window locks, segv in close_mixers + exportedl, ffmpeg default...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / asset.C
index 4665551c0ca61fc0dafd87a2915a6c0dc3eb8fc1..4b42feff174dc601e3ceef53908c89d335158b0e 100644 (file)
@@ -72,7 +72,6 @@ int Asset::init_values()
        path[0] = 0;
 // Has to be unknown for file probing to succeed
        format = FILE_UNKNOWN;
-       fformat[0] = 0;
        bits = 0;
        byte_order = 0;
        signed_ = 0;
@@ -84,9 +83,13 @@ int Asset::init_values()
        strcpy(vcodec, "");
        strcpy(acodec, "");
 
+       strcpy(fformat,"mp4");
        ff_audio_options[0] = 0;
-       ff_video_options[0] = 0;
+       ff_sample_format[0] = 0;
        ff_audio_bitrate = 0;
+       ff_audio_quality = -1;
+       ff_video_options[0] = 0;
+       ff_pixel_format[0] = 0;
        ff_video_bitrate = 0;
        ff_video_quality = -1;
 
@@ -96,6 +99,7 @@ int Asset::init_values()
        interlace_mode = ILACE_MODE_UNDETECTED;
        interlace_fixmethod = ILACE_FIXMETHOD_NONE;
 
+       mp3_bitrate = 224;
        ampeg_bitrate = 256;
        ampeg_derivative = 3;
 
@@ -128,11 +132,14 @@ int Asset::init_values()
        ac3_bitrate = 128;
 
        png_use_alpha = 0;
+
        exr_use_alpha = 0;
        exr_compression = 0;
 
        tiff_cmodel = 0;
        tiff_compression = 0;
+       mov_sphere = 0;
+       jpeg_sphere = 0;
 
        use_header = 1;
        id = EDL::next_id();
@@ -219,8 +226,11 @@ void Asset::copy_format(Asset *asset, int do_index)
        strcpy(acodec, asset->acodec);
 
        strcpy(ff_audio_options, asset->ff_audio_options);
-       strcpy(ff_video_options, asset->ff_video_options);
+       strcpy(ff_sample_format, asset->ff_sample_format);
        ff_audio_bitrate = asset->ff_audio_bitrate;
+       ff_audio_quality = asset->ff_audio_quality;
+       strcpy(ff_video_options, asset->ff_video_options);
+       strcpy(ff_pixel_format, asset->ff_pixel_format);
        ff_video_bitrate = asset->ff_video_bitrate;
        ff_video_quality = asset->ff_video_quality;
 
@@ -270,6 +280,10 @@ void Asset::copy_format(Asset *asset, int do_index)
 
        tiff_cmodel = asset->tiff_cmodel;
        tiff_compression = asset->tiff_compression;
+       
+       
+       mov_sphere = asset->mov_sphere;
+       jpeg_sphere = asset->jpeg_sphere;
 }
 
 int64_t Asset::get_index_offset(int channel)
@@ -344,8 +358,9 @@ int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl)
                        !strcmp(acodec, asset.acodec));
                if(result && format == FILE_FFMPEG)
                        result = !strcmp(ff_audio_options, asset.ff_audio_options) &&
-                               ff_audio_bitrate == asset.ff_audio_bitrate;
-
+                               !strcmp(ff_sample_format, asset.ff_sample_format) &&
+                               ff_audio_bitrate == asset.ff_audio_bitrate &&
+                               ff_audio_quality == asset.ff_audio_quality;
        }
 
 
@@ -359,9 +374,12 @@ int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl)
                        interlace_fixmethod     == asset.interlace_fixmethod &&
                        width == asset.width &&
                        height == asset.height &&
-                       !strcmp(vcodec, asset.vcodec));
+                       !strcmp(vcodec, asset.vcodec) &&
+                       mov_sphere == asset.mov_sphere &&
+                       jpeg_sphere == asset.jpeg_sphere);
                if(result && format == FILE_FFMPEG)
                        result = !strcmp(ff_video_options, asset.ff_video_options) &&
+                               !strcmp(ff_pixel_format, asset.ff_pixel_format) &&
                                ff_video_bitrate == asset.ff_video_bitrate &&
                                ff_video_quality == asset.ff_video_quality;
        }
@@ -505,6 +523,8 @@ int Asset::read_video(FileXML *file)
        file->tag.get_property("VCODEC", vcodec);
 
        video_length = file->tag.get_property("VIDEO_LENGTH", (int64_t)0);
+       mov_sphere = file->tag.get_property("MOV_SPHERE", 0);
+       jpeg_sphere = file->tag.get_property("JPEG_SPHERE", 0);
        single_frame = file->tag.get_property("SINGLE_FRAME", (int64_t)0);
 
        interlace_autofixoption = file->tag.get_property("INTERLACE_AUTOFIX",0);
@@ -660,6 +680,8 @@ int Asset::write_video(FileXML *file)
                file->tag.set_property("VCODEC", vcodec);
 
        file->tag.set_property("VIDEO_LENGTH", video_length);
+       file->tag.set_property("MOV_SPHERE", mov_sphere);
+       file->tag.set_property("JPEG_SPHERE", jpeg_sphere);
        file->tag.set_property("SINGLE_FRAME", single_frame);
 
        file->tag.set_property("INTERLACE_AUTOFIX", interlace_autofixoption);
@@ -780,8 +802,11 @@ void Asset::load_defaults(BC_Hash *defaults,
        theora_keyframe_force_frequency = GET_DEFAULT("THEORA_FORCE_KEYFRAME_FREQUENCY", theora_keyframe_force_frequency);
 
        GET_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options);
+       GET_DEFAULT("FF_SAMPLE_FORMAT", ff_sample_format);
        ff_audio_bitrate = GET_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate);
+       ff_audio_quality = GET_DEFAULT("FF_AUDIO_QUALITY", ff_audio_quality);
        GET_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options);
+       GET_DEFAULT("FF_PIXEL_FORMAT", ff_pixel_format);
        ff_video_bitrate = GET_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate);
        ff_video_quality = GET_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
 
@@ -824,6 +849,8 @@ void Asset::load_defaults(BC_Hash *defaults,
        tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel);
        tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", tiff_compression);
 
+       mov_sphere = GET_DEFAULT("MOV_SPHERE", mov_sphere);
+       jpeg_sphere = GET_DEFAULT("JPEG_SPHERE", jpeg_sphere);
        boundaries();
 }
 
@@ -869,8 +896,11 @@ void Asset::save_defaults(BC_Hash *defaults,
                UPDATE_DEFAULT("VORBIS_MAX_BITRATE", vorbis_max_bitrate);
 
                UPDATE_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options);
+               UPDATE_DEFAULT("FF_SAMPLE_FORMAT", ff_sample_format);
                UPDATE_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate);
+               UPDATE_DEFAULT("FF_AUDIO_QUALITY", ff_audio_quality);
                UPDATE_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options);
+               UPDATE_DEFAULT("FF_PIXEL_FORMAT",  ff_pixel_format);
                UPDATE_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate);
                UPDATE_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
 
@@ -911,8 +941,16 @@ void Asset::save_defaults(BC_Hash *defaults,
                UPDATE_DEFAULT("EXR_COMPRESSION", exr_compression);
                UPDATE_DEFAULT("TIFF_CMODEL", tiff_cmodel);
                UPDATE_DEFAULT("TIFF_COMPRESSION", tiff_compression);
+
+
+
+               UPDATE_DEFAULT("MOV_SPHERE", mov_sphere);
+               UPDATE_DEFAULT("JPEG_SPHERE", jpeg_sphere);
        }
 
+
+
+
        if(do_bits)
        {
                UPDATE_DEFAULT("BITS", bits);
@@ -961,8 +999,11 @@ int Asset::dump(FILE *fp)
        fprintf(fp,"   format %d\n", format);
        fprintf(fp,"   fformat=\"%s\"\n", fformat);
        fprintf(fp,"   ff_audio_options=\"%s\"\n", ff_audio_options);
+       fprintf(fp,"   ff_sample_format=\"%s\"\n", ff_sample_format);
        fprintf(fp,"   ff_audio_bitrate=%d\n", ff_audio_bitrate);
+       fprintf(fp,"   ff_audio_quality=%d\n", ff_audio_quality);
        fprintf(fp,"   ff_video_options=\"%s\"\n", ff_video_options);
+       fprintf(fp,"   ff_pixel_format=\"%s\"\n", ff_pixel_format);
        fprintf(fp,"   ff_video_bitrate=%d\n", ff_video_bitrate);
        fprintf(fp,"   ff_video_quality=%d\n", ff_video_quality);
        fprintf(fp,"   audio_data %d channels %d samplerate %d bits %d"
@@ -977,6 +1018,7 @@ int Asset::dump(FILE *fp)
                video_data, layers, program, frame_rate, width, height,
                vcodec, aspect_ratio,string);
        fprintf(fp,"   video_length %jd repeat %d\n", video_length, single_frame);
+       printf("   mov_sphere=%d jpeg_sphere=%d\n", mov_sphere, jpeg_sphere);
        return 0;
 }