Required steps before start joining
To perform the joining task correctly, you should make the following:
- Initialize the SMM Editing Engine. If you use the only instance of the editing engine, you can initialize it once when the application starts. You can optoinaly set the ITrimmerObjectCB interface to the editing engine (See ITrimmerObjectCB interface and SMAT_Callback for more information).
This step is shown in the InitEngine() member function of SimpleJoiner Sample.
- Make the list of files to be joined, and make sure they have the same type. It is important step. To do this, use SMAT_GetFileType parameter (See other Editing Engine Parameters for more information).
- Initialize the SMM_GROUP_TASK and create the appropiate number of clips. Then fill in allocated SMM_CLIP_INFO and SMM_GROUP_TASK (See other Editing Engine structures) with the most significant parameters.
You should fill structures as follows:
szDstName (SMM_GROUP_TASK) - the output file's name;
nTaskType (SMM_GROUP_TASK) - should be set to SMM_Task_Type_Joining;
tracks (SMM_GROUP_TASK) - contains the pClips structure. Only the tracks[0] should be used.
nVideoStream / nAudioStream (SMM_TRACK_INFO) - the ordered number of video/audio stream to be used for joining. Because files may contain multiple streams these both parameters should be set to -1, which means that all streams in the file would be used;
pClips (SMM_TRACK_INFO) - pointer to an array of clips. The array elements' number should be the same as the number of parts to be joined (currently equal to the count of files). Each element should describe single part to be joined (the whole file or separate interval of a file).
dwClipNum - ordered number of the clip;
rtStart / rtEnd - the start/end of the interval of file to be joined. Currently this fields should be set to 0, which means that the whole file should be appended to the ouput.
wsfName - the name of the file to be appended.
This step is shown in the GetGroupTaskFromList() member function.
- Set the folllowing parameters of SMM Editing Engine:
See Editing Engine Parameters for more information.
Don't forget to free memory allocated for the SMM_TRACK_INFO member of SMM_GROUP_TASK.
Also, please note that the settings won't take place until they will be committed due to IModuleConfig specification. (See IModuleConfig::CommitChanges).
- Validate files compatibility (for more information see SMAT_ValidateFiles parameter description).
After you've performed all these steps and if the validation succeeded, the SMM Editing Engine is fully tuned up for joining. You can start joining now.
All these steps are shown in SimpleJoiner Sample source codes (mostly in ConfigureTrimmerObject() member function). Please, pay attention on the comments.