User Tools

Site Tools


general:source_file_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
general:source_file_notes [2010/04/16 23:43]
j.m
general:source_file_notes [2010/04/17 02:19]
j.m
Line 3: Line 3:
 This section of the documentation is designed to help outside (and inside) code writers quickly figure out where a patch or feature needs to be written for, as well as generally provide an overview of the source files and their purposes. Files in Avidemux tend to do more than just one task, so most information here will not always describe the full range of a file's functions. This section of the documentation is designed to help outside (and inside) code writers quickly figure out where a patch or feature needs to be written for, as well as generally provide an overview of the source files and their purposes. Files in Avidemux tend to do more than just one task, so most information here will not always describe the full range of a file's functions.
  
-=====  General notes  =====+===== General notes =====
  
-Avidemux is written using the C/C++ programming language, but it does not use the STL, though this is not a very big deal in general. Avidemux is built with the [[http://​www.gtk.org/​|GTK+]] graphical libraries. Lastly Avidemux also has the [[http://​www.mozilla.org/​js/​spidermonkey/​|SpiderMonkey]] ECMAScript scripting engine built into it for project handling. As of yet, this cannot be directly called by Avidemux. If you want to add code or edit code for Avidemux, you will need to understand these languages and libraries. The ECMAScript is rarely used outside of a few specific functions, so most people do not need to know it if they want to modify code. However C/C++ and GTK+ are usually necessary knowledge.+Avidemux is written using the C++ programming language, but it does not use the STL, though this is not a very big deal in general. Avidemux is built with the [[http://​www.gtk.org/​|GTK+]] graphical libraries. Lastly Avidemux also has the [[http://​www.mozilla.org/​js/​spidermonkey/​|SpiderMonkey]] ECMAScript scripting engine built into it for project handling. As of yet, this cannot be directly called by Avidemux. If you want to add code or edit code for Avidemux, you will need to understand these languages and libraries. The ECMAScript is rarely used outside of a few specific functions, so most people do not need to know it if they want to modify code. However C/C++ and GTK+ are usually necessary knowledge.
  
-Avidemux makes heavy use of polymorphims ​and class derivation. This means that in most of the source files you will see calls to functions and variables that are not always present in the written file itself.+Avidemux makes heavy use of polymorphism ​and class derivation.
  
-=====  General architecture ​ =====+===== General architecture =====
  
-Any processing can be seen as having 3 working parts : +Any processing can be seen as having 3 working parts:
-  * The demuxer : All demuxers are derivated from the vidHeader class and provide information and access capabilities. Among the capabilities,​ there is the ability to retrieve any frame and the associated flags with no need for sequential seeking. +
-  * The editor : The editor'​s job is to associate codecs to the streams present in the demuxer'​s output. The editor also handles editing (append, cut, etc...) and the b-frame reordering logic. The GUI ask for a frame from the editor, and the editor manages all the logic by itself. Normally adding a new [[file|format]] does NOT modify the editor. +
-  * The output muxer : All output muxers are in directories beginning with oplug_ and each one deals with one [[file|output format]].+
  
-=====  Directory/​avidemux/ ​ =====+  * The demuxer: All demuxers are derived from the vidHeader class and provide information and access capabilities. Among the capabilities,​ there is the ability to retrieve any frame and the associated flags with no need for sequential seeking. 
 +  * The editorThe editor'​s job is to associate codecs to the streams present in the demuxer'​s output. The editor also handles editing (append, cut, etc...) and the B-frame reordering logic. The GUI asks for a frame from the editor, and the editor manages all the logic by itself. Normally adding a new file format does NOT modify the editor. 
 +  * The output muxer: All output muxers are in directories beginning with oplug_ and each one deals with one file output format.
  
-  * //​ADM_pp.cpp// ​Post processing filter code +===== Directory: /avidemux=====
-  * //ADM_pp.h// : Post processing filter code headers +
-  * //​gtk_gui.cpp//​ : Controls all of the GUI. Makes calls to various other GUI dialogs and inputs. ​+
  
-====  ADM_3gp ​ ==== +  * //​ADM_pp.cpp//:​ Postprocessing filter code. 
-Contains [[QuickTime]],​ [[MP4]], [[3GPP]] input handling+  * //​ADM_pp.h//:​ Postprocessing filter code headers. 
 +  * //​gtk_gui.cpp//:​ Controls all of the GUI. Makes calls to various other GUI dialogs and inputs. ​
  
-  * //ADM_3gp.cpp// : among other things, this handles the QuickTime, MP4, 3GPP input formats (demuxing, variants) +==== ADM_3gp ​====
-  * //​ADM_3gp.h//​ : among other things, this handles the QuickTime, MP4, 3GPP input formats (demuxing, variants)+
  
-====  ADM_audiofilter ​ ==== +Contains QuickTime, MP4, 3GPP input handling 
-Contains audio filter files (generally not the source code for the audio codecs themselves),​ including the Mixer.+ 
 +  * //​ADM_3gp.cpp//:​ Among other things, this handles the QuickTime, MP4, 3GPP input formats (demuxing, variants). 
 +  * //​ADM_3gp.h//:​ Among other things, this handles the QuickTime, MP4, 3GPP input formats (demuxing, variants). 
 + 
 +==== ADM_audiofilter ==== 
 + 
 +Contains audio filter files (generally not the source code for the audio codecs themselves),​ including the mixer.
 Encoding is seen as a filter so interfaces to audio encoders are in that directory too. Encoding is seen as a filter so interfaces to audio encoders are in that directory too.
  
-  * //​audioencoder.cpp//​ : Code for the general audio processing within Avidemux +  * //​audioencoder.cpp//:​ Code for the general audio processing within Avidemux 
-  * //​audioencoder.h//​ : Header code for audioencoder.cpp +  * //​audioencoder.h//:​ Header code for audioencoder.cpp 
-  * //​audioencoder_faac.cpp//​ : Faac audio codec encoder source code +  * //​audioencoder_faac.cpp//: ​FAAC audio encoder source code 
-  * //​audioencoder_faac.h//​ : Header code for Faac encoder  +  * //​audioencoder_faac.h//:​ Header code for the FAAC encoder  
-  * //​audioencoder_lame.cpp//​ : Lame audio codec encoder source code +  * //​audioencoder_lame.cpp//: ​LAME audio encoder source code 
-  * //​audioencoder_lame_param.h//​ Parameter header file for Lame audio codec encoder , #included and used in the ADM_dialog/​DIA_lame.cpp +  * //​audioencoder_lame_param.h//​Parameter header file for the LAME audio encoder, #included and used in ADM_dialog/​DIA_lame.cpp 
-  * //​audioencoder_lavcodec.cpp//​ :  +  * //​audioencoder_lavcodec.cpp//:​  
-  * //​audioencoder_lavcodec.h//​ : +  * //​audioencoder_lavcodec.h//:​ 
-  * //​audioencoder_pcm.cpp//​ : PCM audio codec encoder source code +  * //​audioencoder_pcm.cpp//:​ PCM audio encoder source code 
-  * //​audioencoder_pcm.cpp//​ : Header code for PCM audio codec encoder source code +  * //​audioencoder_pcm.cpp//:​ Header code for the PCM audio encoder source code 
-  * //​audioencoder_twolame.cpp//​ : Twolame ​audio codec encoder source code +  * //​audioencoder_twolame.cpp//: ​TwoLAME ​audio encoder source code 
-  * //​audioencoder_twolame.h//​ : Header code for Twolame codec encoder +  * //​audioencoder_twolame.h//:​ Header code for TwoLAME ​encoder 
-  * //​audioencoder_vorbis.cpp//​ : Vorbis audio codec encoder source code +  * //​audioencoder_vorbis.cpp//:​ Vorbis audio encoder source code 
-  * //​audioencoder_vorbis.h//​ : Header code for Vorbis audio codec encoder source code +  * //​audioencoder_vorbis.h//:​ Header code for the Vorbis audio encoder source code 
-  * //​audioencoder_vorbis_param.h//​ : Parameter header file for Vorbis audio codec encoder, probably #included and used in the ADM_dialog/​DIA_vorbis.cpp +  * //​audioencoder_vorbis_param.h//:​ Parameter header file for the Vorbis audio encoder, probably #included and used in ADM_dialog/​DIA_vorbis.cpp 
-  * //​audiofilter_mixer.cpp//​ : The audio filter mixer+  * //​audiofilter_mixer.cpp//:​ The audio filter mixer
  
-====  ADM_audiocodec ​ ====+==== ADM_audiocodec ====
  
 Files for encoding to various (audio) codecs (decoder only, see this page's link list for encoders) Files for encoding to various (audio) codecs (decoder only, see this page's link list for encoders)
-  * //​ADM_codecac3.cpp//​ : [[Glossary#​AC3|AC3]] audio handling, including Dolby 
-  * //​ADM_codecwma.cpp//​ : [[Glossary#​WMA|WMA]] audio handling 
  
-====  ADM_codecs ​ ====+  * //​ADM_codecac3.cpp//:​ [[Glossary#​AC-3|AC3]] audio handling, including Dolby 
 +  * //​ADM_codecwma.cpp//:​ [[Glossary#​WMA|WMA]] audio handling 
 + 
 +==== ADM_codecs ==== 
 + 
 +Files for encoding with various (video) codecs 
 + 
 +  * //ADM_codecs.cpp//: Store some of the FourCC code for use with encoding/​decoding video via the libavcodec 
 +  * //​ADM_ffmpeg.cpp//:​ The FFmpeg codecs source codes themselves 
 +  * //​ADM_x264.cpp//:​ The x264 encoder 
 +  * //​ADM_x264.h//:​ A header file for the x264 encoder 
 +  * //​ADM_xvid4.cpp//:​ The Xvid encoder 
 +  * //​ADM_xvid4.h//:​ A header file for the Xvid encoder 
 +  * //​ADM_ffmp43.cpp//​ : Decoders related to the FFmpeg libavcodec library 
 + 
 +==== ADM_dialog ==== 
 + 
 +GUI dialogs and windows for filters, codec configs, preferences,​ etc. Mostly everyting with a GUI can be found in this directory. 
 + 
 +  * //​DIA_calculator.cpp//:​ Bitrate calculator dialog 
 +  * //​DIA_crop.cpp//:​ [[using:​Video filter Crop|Crop]] video filter dialog 
 +  * //​DIA_defaultAudio.cpp//:​ Default user interface dialog for audio codecs 
 +  * //​DIA_DVDff.cpp//:​ FFmpeg MPEG-2 DVD dialog 
 +  * //​DIA_encoding.cpp//:​ Encoding information dialog/​window 
 +  * //​DIA_jobs_save.cpp//:​ "Save to Joblist"​ dialog 
 +  * //​DIA_jobs.cpp//:​ "​Joblist"​ dialog 
 +  * //​DIA_lame.cpp//:​ LAME audio encoder dialog 
 +  * //​DIA_mcdeint.cpp//:​ mcDeinterlace video filter dialog 
 +  * //​DIA_ocr.cpp//:​ "​[[Glossary#​OCR|OCR]] (VobSub <​nowiki>​-></​nowiki>​ srt)" subtitles dialog window 
 +  * //​DIA_prefs.cpp//:​ Preferences dialog 
 +  * //​DIA_preview.cpp//:​ Video preview dialog 
 +  * //​DIA_properties.cpp//:​ Video properties dialog 
 +  * //​DIA_srt.cpp//:​ Subtitle filter dialog 
 +  * //​DIA_vcodec.cpp//:​ Appears to be the old encoding codec list pulldown menu. May be obsolete. 
 +  * //​DIA_vobsub.cpp//:​ VobSub subtitle dialog 
 +  * //​DIA_vorbis.cpp//:​ Vorbis audio codec pulldown menu  
 +  * //​DIA_working.cpp//:​ Video encoding status window 
 +  * //​DIA_x264.cpp//:​ x264 configuration dialog 
 +  * //​DIA_xvid4.cpp//:​ Xvid configuration dialog 
 + 
 +==== ADM_encoder ==== 
 + 
 +Contains source files that handle the high level video encoders. The high level encoders offer the same interface to core whatever the codec used. They also handle internally the setup for 2-pass encoding. They can be seen as an abstraction layer. 
 + 
 +  * //​ADM_encCodecDesc.h//:​ Contains default codec value settings (for GUI dialogs) that are loaded on startup. 
 +  * //​ADM_vidEncode.hxx//:​ Codec dialog options (like 2-pass file size, 2-pass bitrate, quantizer). Contains codec names for use when passing as parameters to other functions. 
 +  * //​adm_encffmpeg1.cpp//:​ FFmpeg MPEG-1 encoder 
 +  * //​adm_encx264.cpp//:​ C++ implementation of the x264 encoder, contains all the internal Avidemux function calls to other functions, including encode, logging, and computing bitrate. 
 + 
 +==== ADM_filter ==== 
 + 
 +Contains the management code (loading and GUI's) for the video filters. For actual video filter files see [[Source file notes#​ADM_video|ADM_video]]. 
 + 
 +  * //​filter_declaration.cpp//:​ Handles some of the loading and declaring of files. 
 +  * //​video_filter.h//:​ Handles some of the loading and declaring of video filter names, descriptions,​ configurations. 
 + 
 +==== ADM_lavcodec ​====
  
-Files for encoding to various ​(video) ​codecs +Contains lots of various codecs ​handled by libavcodec ​and associated ​codecs.
-  * //​ADM_codecs.cpp//​ : Store some of the [[FourCC]] code for use with encoding/​decoding video via the libavcodec +
-  * //​ADM_ffmpeg.cpp//​ : The [[FFmpeg]] ​codecs ​source codes themselves +
-  * //​ADM_x264.cpp//​ : The [[x264]]/​[[h264]] codec source code itself +
-  * //​ADM_x264.h//​ : The [[x264]]/​[[h264]] codec source code itself +
-  * //​ADM_xvid4.cpp//​ : The [[XviD]] codec source code itself +
-  * //​ADM_xvid4.h//​ : The [[XviD]] codec source code itself +
-  * //​ADM_ffmp43.cpp//​ : The decoders related to [[FFmpeg]]'​s libavcodec library.+
  
-====  ​ADM_dialog  ​====+==== ADM_lavformat ​====
  
-GUI dialogs and windows for filters, codec configs, preferences,​ etc. Mostly everyting with a GUI can be found in this directory.  +It is the file format library from FFmpeg. ​It is only used actually to save as MP4There is some dead code to use it to output MPEG(nbsp)TS also.
-  * //​DIA_calculator.cpp//​ : Bitrate calculator dialog +
-  * //​DIA_crop.cpp//​ : [[Video filter Crop|Crop]] video filter dialog +
-  * //​DIA_defaultAudio.cpp//​ : Default user interface dialog for audio codecs +
-  * //​DIA_DVDff.cpp//​ : [[FFmpeg]] [[MPEG-2]] [[DVD]] dialog +
-  * //​DIA_encoding.cpp// : Encoding information dialog/​window (How does this different from DIA_working.cpp?) +
-  * //​DIA_jobs_save.cpp//​ : "​Save ​to Joblist"​ dialog +
-  * //​DIA_jobs.cpp//​ : "​Joblist"​ dialog +
-  * //​DIA_lame.cpp//​ : Lame audio encoder dialog +
-  * //​DIA_mcdeint.cpp//​ : [[Video filter mcDeinterlace|mcDeinterlace]] video filter dialog +
-  * //​DIA_ocr.cpp//​ : "​[[Glossary#​OCR|OCR]] ​(Vobsub -> srt)" subtitles dialog window +
-  * //​DIA_prefs.cpp//​ : Menu: Edit -> Preferences dialog +
-  * //​DIA_preview.cpp//​ : Video Preview dialog +
-  * //​DIA_properties.cpp//​ : Video Properties dialog +
-  * //​DIA_srt.cpp//​ : Subtitle Filter dialog +
-  * //​DIA_vcodec.cpp//​ : Appears to be the old encoding codec list pulldown menu. <FONT COLOR="#​990000">​May be obsolete</​FONT>​ +
-  * //​DIA_vobsub.cpp//​ : Vobsub subtitle dialog +
-  * //​DIA_vorbis.cpp//​ : Vorbis audio codec pulldown menu  +
-  * //​DIA_working.cpp//​ : Video Encoding Status Window +
-  * //​DIA_x264.cpp//​ : [[x264]]/​[[h264]] codec configure window +
-  * //DIA_xvid4.cpp// : [[XviD]] codec configure window+
  
-====  ADM_encoder ​ ====+  * //mov.c//: The reading part for QuickTime/​MP4/​3GP/​... Not used by Avidemux but some code is shared with movenc.c which is used. 
 +  * //​movenc.c//:​ Most of the MP4 writing code is here, with very little modifications concerning the way MP3 is stored.
  
-Contains source files that handle the high level video encoders. +==== ADM_library ====
-The high level encoders offer the same interface to core whatever the codec used. +
-They also handle internally the setup for 2 pass encoding. They can be seen as an abstraction layer. +
-  * //​ADM_encCodecDesc.h//​ : Contains default codec value settings (for GUI dialogs) that are loaded on startup +
-  * //​ADM_vidEncode.hxx//​ : Codec dialog options (like 2-pass file size, 2-pass bitrate, quantizer). Contains codec names for use when passing as parameters to other functions +
-  * //​adm_encffmpeg1.cpp//​ : [[FFmpeg]] [[MPEG-1]] encoder +
-  * //​adm_encx264.cpp//​ : C++ implementation of the X264 Encoder, contains all the internal Avidemux function calls to other functions, including encode, logging, and computing bitrate+
  
-====  ADM_filter ​ ====+Contains a miscellanious collection of files for various small and a large tasks, including frames, images, file IO, FourCC information,​ RIFF parser
  
-Contains the management code (loading and GUI's) for the video filters. For actual video filter files see [[#​ADM_video|ADM_video]] +  ​* //default.h//: Contains information about AMD64 fallback typedef settings.
-  ​* //filter_declaration.cpp// : handles some of the loading and declaring of files +
-  * //​video_filter.h// : handles some of the loading and declaring of video filter names, descriptions,​ configurations+
  
-====  ​ADM_lavcodec  ​==== +==== ADM_mplex ​====
-Contains lots of various codecs handled by the libavcodec and associated codecs.+
  
-====  ADM_lavformat ​ ==== +Contains files for audio muxing and demuxing, audio stream information and handling, and various pieces of code relating ​to general audio management.
-It is the file format library from ffmpeg. It is only used actually to save as mp4. There is some dead code to use it to output mpeg TS also.+
  
-  * //mov.c// : The reading part for mov/​mp4/​3Gp/​... Not used by avidemux but some code is shared with movenc.c which is used. +  * //ADM_mthread.cpp: Some multithreaded multiplexing 
-  * //movenc.c// : Most of the mp4 writing code is here, with very little modifications concerning the way mp3 is stored.+  * //ADM_mthread.hHeader ​for some multithreaded multiplexing 
 +  * //interact.cpp//:
  
-====  ​ADM_library  ​==== +==== ADM_script ​====
-Contains a miscellanious collection of files for various small and a large tasks, include frames, images, file IO, [[FourCC]] information,​ riff parser +
-  * //​default.h//​ : Contains information about [[AMD64]] fallback typedef settings+
  
-====  ADM_mplex ​ ==== +Contains ​ECMAScript/​JavaScript scripting ​files and source ​code.
-Contains files for audio muxing ​and demuxing, audio stream information and handling, and various pieces of code relating to general audio management+
  
-  * //ADM_mthread.cpp : Some multithreaded multiplexing +  * //ADM_JSAvidemuxAudio.cpp//: ​code that handles ​
-  * //​ADM_mthread.h : Header for some multithreaded multiplexing +
-  * //interact.cpp// :+
  
-====  ​ADM_script  ​==== +==== ADM_toolkit ​====
-Contains [[ECMA]] [[JavaScript]] scripting files and source code.+
  
-  * //​ADM_JSAvidemuxAudio.cpp// : code that handles ​+Contains some useful functions, mostly GTK+ relatedThere are also some code to emulate UNIX functions on win32.
  
-====  ADM_toolkit ​ ====+  * //​ADM_threads.cpp//:​ Uncertain multithreading code 
 +  * //​ADM_threads.h//:​ Uncertain multithreading code 
 +  * //​eggtray_win32.c//:​ Animated icon for Win32 
 +  * //​TLK_filesel.cpp//:​ File selection functions (read/​write)
  
-Contains some useful functions, mostly gtk related. There are also some code to emulate unix functions on win32.+==== ADM_script ====
  
-  * //​ADM_threads.cpp// : uncertain multithreading code +Controls the scripts (most specifically the ECMAScript ​.js scripts).
-  * //​ADM_threads.h// : uncertain multithreading code +
-  * //​eggtray_win32.c//​ : Animated icon for [[Win32]] +
-  * //​TLK_filesel.cpp//​ : File selection functions (read/​write)+
  
-====  ​ADM_script  ​==== +==== ADM_video ​====
-Controls the scripts (most specifically the [[ECMA]] .js scripts)+
  
-====  ADM_video ​ ==== +Contains most of the actual source files for video filters.
-Contains most of the actual source files for video filters+
  
-Each filter is declared as a c++ class. They are all derivated ​from the same class. They all use one input and one output and are chained together.+Each filter is declared as a C++ class. They are all derived ​from the same class. They all use one input and one output and are chained together.
  
-They exchange their configuration with the outside world through the Couples class that does the translation between a parameter name and its value. Most of the filters are ported from mplayer ​or avisynth. The internals of avidemux ​are close to both of them. There is also some code to provide a C emulation layer to avisynth ​so that porting code is easier.+They exchange their configuration with the outside world through the Couples class that does the translation between a parameter name and its value. Most of the filters are ported from MPlayer ​or Avisynth. The internals of Avidemux ​are close to both of them. There is also some code to provide a C emulation layer to Avisynth ​so that porting code is easier.
  
-  * //​ADM_vidMcDeint.cpp//​ : Actual source code for the [[Video|filter ​mcDeinterlace]]+  * //​ADM_vidMcDeint.cpp//​ : Actual source code for the mcDeinterlace ​filter
general/source_file_notes.txt · Last modified: 2012/11/11 08:51 (external edit)