X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffiledv.C;h=14ddbf743a66b793e21bd0230af87ce5c4d70ac0;hb=31dcf588195639485c379434882b98f110063c8e;hp=bcce24b21201bd11c7d09310e9d2cf1632a653f5;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/filedv.C b/cinelerra-5.1/cinelerra/filedv.C index bcce24b2..14ddbf74 100644 --- a/cinelerra-5.1/cinelerra/filedv.C +++ b/cinelerra-5.1/cinelerra/filedv.C @@ -229,9 +229,9 @@ TRACE("FileDV::open_file 20") encoder->isPAL = isPAL; output_size = (isPAL ? DV1394_PAL_FRAME_SIZE : DV1394_NTSC_FRAME_SIZE); - // Compare to 16 / 8 rather than == 16 / 9 in case of floating point - // rounding errors - encoder->is16x9 = asset->aspect_ratio > 16 / 8; + //printf("filedv aspect- %f \n", asset->aspect_ratio); + if(1.777778 - asset->aspect_ratio < 0.001f) + encoder->is16x9 = 1; } else { @@ -602,6 +602,7 @@ UNTRACE int FileDV::write_frames(VFrame ***frames, int len) { int result = 0; + time_t now = time(NULL); if(stream == 0) return 1; @@ -619,11 +620,15 @@ int FileDV::write_frames(VFrame ***frames, int len) //printf("FileDV::write_frames: 4\n"); dv_encode_full_frame(encoder, temp_frame->get_rows(), e_dv_color_yuv, video_buffer); + dv_encode_metadata(video_buffer, encoder->isPAL, encoder->is16x9, &now, 0); + dv_encode_timecode(video_buffer, encoder->isPAL, 0); break; case BC_RGB888: //printf("FileDV::write_frames: 5\n"); dv_encode_full_frame(encoder, temp_frame->get_rows(), e_dv_color_rgb, video_buffer); + dv_encode_metadata(video_buffer, encoder->isPAL, encoder->is16x9, &now, 0); + dv_encode_timecode(video_buffer, encoder->isPAL, 0); break; default: unsigned char *data = new unsigned char[asset->height * asset->width * 2]; @@ -633,27 +638,13 @@ int FileDV::write_frames(VFrame ***frames, int len) for(int i = 0; i < asset->height; i++) cmodel_buf[i] = data + asset->width * 2 * i; - BC_CModels::transfer(cmodel_buf, - row_pointers, - cmodel_buf[0], - cmodel_buf[1], - cmodel_buf[2], - row_pointers[0], - row_pointers[1], - row_pointers[2], - 0, - 0, - asset->width, - asset->height, - 0, - 0, - asset->width, - asset->height, - temp_frame->get_color_model(), - BC_YUV422, - 0, - asset->width, - asset->width); + BC_CModels::transfer(cmodel_buf, row_pointers, + cmodel_buf[0], cmodel_buf[1], cmodel_buf[2], + row_pointers[0], row_pointers[1], row_pointers[2], + 0, 0, asset->width, asset->height, + 0, 0, asset->width, asset->height, + temp_frame->get_color_model(), BC_YUV422, 0, + asset->width, asset->width); dv_encode_full_frame(encoder, cmodel_buf, e_dv_color_yuv, video_buffer); @@ -868,27 +859,13 @@ TRACE("FileDV::read_frame 69") TRACE("FileDV::read_frame 70") - BC_CModels::transfer(row_pointers, - temp_pointers, - row_pointers[0], - row_pointers[1], - row_pointers[2], - temp_pointers[0], - temp_pointers[1], - temp_pointers[2], - 0, - 0, - asset->width, - asset->height, - 0, - 0, - asset->width, - asset->height, - BC_YUV422, - frame->get_color_model(), - 0, - asset->width, - asset->width); + BC_CModels::transfer(row_pointers, temp_pointers, + row_pointers[0], row_pointers[1], row_pointers[2], + temp_pointers[0], temp_pointers[1], temp_pointers[2], + 0, 0, asset->width, asset->height, + 0, 0, asset->width, asset->height, + BC_YUV422, frame->get_color_model(), 0, + asset->width, asset->width); //for(int i = 0; i < asset->height; i++) // delete[] temp_pointers[i]; @@ -925,21 +902,16 @@ int FileDV::get_best_colormodel(Asset *asset, int driver) { case PLAYBACK_X11: return BC_RGB888; - break; case PLAYBACK_X11_XV: return BC_YUV422; - break; case PLAYBACK_DV1394: case PLAYBACK_FIREWIRE: return BC_COMPRESSED; - break; case VIDEO4LINUX2: case VIDEO4LINUX2JPEG: return BC_YUV422; - break; case CAPTURE_FIREWIRE: return BC_COMPRESSED; - break; } return BC_RGB888; } @@ -958,34 +930,17 @@ int FileDV::get_audio_offset(int64_t pos) return pos - frame * asset->sample_rate / asset->frame_rate; } - - - - - - - - - - - - - - - - - - - DVConfigAudio::DVConfigAudio(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Audio Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 350, 250) + xS(350), yS(250)) { this->parent_window = parent_window; this->asset = asset; +// *** CONTEXT_HELP *** + context_help_set_keyword("Single File Rendering"); } DVConfigAudio::~DVConfigAudio() @@ -996,7 +951,7 @@ DVConfigAudio::~DVConfigAudio() void DVConfigAudio::create_objects() { lock_window("DVConfigAudio::create_objects"); - add_tool(new BC_Title(10, 10, _("There are no audio options for this format"))); + add_tool(new BC_Title(xS(10), yS(10), _("There are no audio options for this format"))); add_subwindow(new BC_OKButton(this)); unlock_window(); } @@ -1012,10 +967,12 @@ DVConfigVideo::DVConfigVideo(BC_WindowBase *parent_window, Asset *asset) : BC_Window(_(PROGRAM_NAME ": Video Compression"), parent_window->get_abs_cursor_x(1), parent_window->get_abs_cursor_y(1), - 350, 250) + xS(350), yS(250)) { this->parent_window = parent_window; this->asset = asset; +// *** CONTEXT_HELP *** + context_help_set_keyword("Single File Rendering"); } DVConfigVideo::~DVConfigVideo() @@ -1026,7 +983,7 @@ DVConfigVideo::~DVConfigVideo() void DVConfigVideo::create_objects() { lock_window("DVConfigVideo::create_objects"); - add_tool(new BC_Title(10, 10, _("There are no video options for this format"))); + add_tool(new BC_Title(xS(10), yS(10), _("There are no video options for this format"))); add_subwindow(new BC_OKButton(this)); unlock_window(); }