planning next implementation steps

This commit is contained in:
Fischlurch 2007-09-20 05:36:08 +02:00
parent dc97acde5e
commit 5d54cfc89e
8 changed files with 290 additions and 35 deletions

View file

@ -16,6 +16,10 @@ return: 0
END
PLANNED "CompoundMedia_test" CompoundMedia_test <<END
END
PLANNED "DeleteAsset_test" DeleteAsset_test <<END
END
@ -29,6 +33,10 @@ return: 0
END
PLANNED "MediaStructureQuery_test" MediaStructureQuery_test <<END
END
TEST "OrderingOfAssets_test" OrderingOfAssets_test <<END
return: 0
END

View file

@ -0,0 +1,103 @@
/*
CompoundMedia(Test) - handling multichannel Media Assets
Copyright (C) CinelerraCV
2007, Christian Thaeter <ct@pipapo.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "common/test/run.hpp"
#include "common/util.hpp"
#include "proc/assetmanager.hpp"
#include "proc/asset/media.hpp"
#include "proc/asset/proc.hpp"
#include "proc/asset/assetdiagnostics.hpp"
using util::isnil;
using std::string;
namespace asset
{
namespace test
{
/***********************************************************************
* Verifying the special operations available for compound media assets
* comprised of several elementary media assets.
*/
class CompoundMedia_test : public Test
{
virtual void run(Arg arg)
{
buildCompound();
modifyCompound();
verifyClipStructure();
if (!isnil (arg))
dumpAssetManager();
TRACE (assetmem, "leaving CreateAsset_test::run()");
}
typedef shared_ptr<asset::Media> PM;
/** @test building a compound media asset by using a special
* factory, normally intended for loading existing sessions.
*/
void buildCompound()
{
}
/** @test adding and removing elementary media.
*/
void modifyCompound()
{
}
/** @test create a (compound) clip from some compound media asset
* and verify the clip mirrors the media asset's structure
*/
void verifyClipStructure()
{
}
bool checkProperties (PM object, Asset::Ident identity, string filename)
{
return identity == object->ident
&& filename == object->getFilename();
}
};
/** Register this test class... */
LAUNCHER (CompoundMedia_test, "unit asset");
} // namespace test
} // namespace asset

View file

@ -0,0 +1,68 @@
/*
MediaStructureQuery(Test) - check functionallity used for creating media assets
Copyright (C) CinelerraCV
2007, Christian Thaeter <ct@pipapo.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "common/test/run.hpp"
#include "common/util.hpp"
#include "proc/assetmanager.hpp"
#include "proc/asset/media.hpp"
#include "proc/asset/proc.hpp"
#include "proc/asset/assetdiagnostics.hpp"
using util::isnil;
using std::string;
namespace asset
{
namespace test
{
/***********************************************************************
* This test documents the Interface used by MediaFactory when loading
* media files for querying cinelerra's backend layer for information
* on how the media file is structured.
*/
class MediaStructureQuery_test : public Test
{
virtual void run(Arg arg)
{
UNIMPLEMENTED ("querying media file structure from backend");
}
};
/** Register this test class... */
LAUNCHER (MediaStructureQuery_test, "unit asset");
} // namespace test
} // namespace asset

View file

@ -1,6 +1,6 @@
format 40
"Asset" // ProcessingLayer::Asset
revision 6
revision 7
modified_by 5 "hiv"
// class settings
//class diagram settings
@ -356,6 +356,39 @@ ${inlines}
end
end
class 138501 "CompoundMedia"
visibility public
cpp_decl "${comment}${template}class ${name}${inherit}
{
${members} };
${inlines}
"
java_decl ""
idl_decl ""
explicit_switch_type ""
comment "compound of several elementary media tracks,
e.g. the individual media streams found in one media file"
classrelation 142213 // <generalisation>
relation 140421 ---|>
a public
cpp default "${type}"
classrelation_ref 142213 // <generalisation>
b multiplicity "" parent class_ref 136709 // Media
end
classrelation 142341 // tracks (<directional aggregation>)
relation 140549 o-->
stereotype "vector"
a role_name "tracks" multiplicity "1..*" protected
comment "elementary media assets comprising this compound"
cpp default " ${comment}${static}${mutable}${volatile}${const}${stereotype}<${type} *> ${name}${value};
"
classrelation_ref 142341 // tracks (<directional aggregation>)
b multiplicity "*" parent class_ref 136709 // Media
end
end
class 136837 "Proc"
visibility public
cpp_decl "${comment}${template}class ${name}${inherit}

View file

@ -10,22 +10,22 @@ classcanvas 128133 class_ref 136581 // AssetManager
end
packagecanvas 128517
package_ref 128133 // Asset
show_context_mode namespace xyzwh 217 182 1994 575 534
show_context_mode namespace xyzwh 217 182 1994 608 534
classcanvas 128645 class_ref 136709 // Media
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 273 347 2005
end
classcanvas 128773 class_ref 136837 // Proc
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 428 347 2005
xyz 503 347 2005
end
classcanvas 128901 class_ref 136965 // Struct
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 603 347 2005
xyz 655 347 2005
end
classcanvas 129029 class_ref 137093 // Meta
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 723 347 2005
xyz 761 347 2005
end
classcanvas 130821 class_ref 137221 // Category
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
@ -33,40 +33,44 @@ classcanvas 130821 class_ref 137221 // Category
end
classcanvas 131077 class_ref 137349 // Clip
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 236 445 2000
xyz 319 445 2000
end
classcanvas 131333 class_ref 137477 // Unknown
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 303 529 2000
xyz 382 529 2000
end
classcanvas 131461 class_ref 137605 // Preview
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 308 445 2005
xyz 387 445 2005
end
classcanvas 131973 class_ref 137733 // Effect
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 402 445 2000
xyz 477 445 2000
end
classcanvas 132101 class_ref 137861 // Codec
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 463 445 2000
xyz 538 445 2000
end
classcanvas 132485 class_ref 137989 // Track
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 563 445 2000
xyz 615 445 2000
end
classcanvas 132613 class_ref 138117 // OutPort
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 626 445 2000
xyz 678 445 2000
end
classcanvas 132997 class_ref 138245 // Dataset
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 719 445 2000
xyz 757 445 2000
end
classcanvas 133253 class_ref 138373 // DB
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 486 233 2000
end
classcanvas 133765 class_ref 138501 // CompoundMedia
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 245 529 2005
end
relationcanvas 129157 relation_ref 138117 // <realization>
geometry VHV
from ref 128645 z 1999 to point 293 315
@ -76,21 +80,21 @@ relationcanvas 129157 relation_ref 138117 // <realization>
no_multiplicity_a no_multiplicity_b
relationcanvas 129285 relation_ref 138245 // <realization>
geometry VHV
from ref 128773 z 1999 to point 448 315
from ref 128773 z 1999 to point 523 315
line 130053 z 1999 to point 138 315
line 130181 z 1999 to ref 128005
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
relationcanvas 129413 relation_ref 138373 // <realization>
geometry VHV
from ref 128901 z 1999 to point 623 315
from ref 128901 z 1999 to point 675 315
line 130309 z 1999 to point 138 315
line 130437 z 1999 to ref 128005
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
relationcanvas 129541 relation_ref 138501 // <realization>
geometry VHV
from ref 129029 z 1999 to point 743 315
from ref 129029 z 1999 to point 781 315
line 130565 z 1999 to point 138 315
line 130693 z 1999 to ref 128005
no_role_a no_role_b
@ -100,11 +104,17 @@ relationcanvas 130949 relation_ref 138629 // <unidirectional association>
role_a_pos 223 229 3000 no_role_b
multiplicity_a_pos 260 250 3000 multiplicity_b_pos 194 194 3000
relationcanvas 131205 relation_ref 138757 // <generalisation>
from ref 131077 z 1999 to ref 128645
geometry VHV
from ref 131077 z 1999 to point 339 415
line 134277 z 1999 to point 293 415
line 134405 z 1999 to ref 128645
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
relationcanvas 131717 relation_ref 139013 // <generalisation>
from ref 131461 z 2004 to ref 128645
geometry VHV
from ref 131461 z 2004 to point 411 415
line 134021 z 2004 to point 293 415
line 134149 z 2004 to ref 128645
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
relationcanvas 131845 relation_ref 139141 // <generalisation>
@ -137,6 +147,16 @@ relationcanvas 133381 relation_ref 140293 // <unidirectional association>
line 133637 z 1999 to ref 133253
role_a_pos 518 208 3000 no_role_b
multiplicity_a_pos 492 208 3000 multiplicity_b_pos 386 104 3000
relationcanvas 134533 relation_ref 140421 // <generalisation>
from ref 133765 z 2004 to ref 128645
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
relationcanvas 134917 relation_ref 140549 // <directional aggregation>
from ref 133765 z 2004 stereotype "<<vector>>" xyz 229 493 3000 to point 225 545
line 135301 z 2004 to point 225 365
line 135173 z 2004 to ref 128645
role_a_pos 230 378 3000 no_role_b
multiplicity_a_pos 231 348 3000 multiplicity_b_pos 230 556 3000
line 128261 -_-_ geometry HV
from ref 128005 z 1999 to point 331 150
line 128389 z 1999 to ref 128133

View file

@ -60,10 +60,14 @@ packagecanvas 135685
package_ref 128261 // MObject
xyzwh 24 10 1994 185 313
packagecanvas 135813
package_ref 128133 // AssetManager
xyzwh 454 10 1994 198 292
package_ref 128133 // Asset
xyzwh 454 10 1994 276 313
note 136837 "the Builder implements each Clip by a source node and maybe some codec"
xyzwh 53 376 2000 219 61
classcanvas 137221 class_ref 138501 // CompoundMedia
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
xyz 606 148 3005
end
relationcanvas 128517 relation_ref 139141 // <generalisation>
from ref 128261 z 1999 to ref 128389
no_role_a no_role_b
@ -142,6 +146,15 @@ relationcanvas 136965 relation_ref 140165 // <unidirectional association>
line 137093 z 1999 to ref 128133
role_a_pos 491 49 3000 no_role_b
multiplicity_a_pos 524 72 3000 multiplicity_b_pos 477 123 3000
relationcanvas 137349 relation_ref 140421 // <generalisation>
from ref 137221 z 1999 to ref 128133
no_role_a no_role_b
no_multiplicity_a no_multiplicity_b
relationcanvas 137477 relation_ref 140549 // <directional aggregation>
from ref 137221 z 1999 to point 654 68
line 137733 z 1999 stereotype "<<vector>>" xyz 662 113 3000 to ref 128133
role_a_pos 602 48 3000 no_role_b
multiplicity_a_pos 605 72 3000 multiplicity_b_pos 642 123 3000
line 136453 -_-_
from ref 136325 z 1998 to ref 128901
end

View file

@ -1,34 +1,28 @@
window_sizes 1140 783 270 860 633 71
diagrams
classdiagram_ref 130309 // Asset Kinds
860 607 100 4 0 0
classdiagram_ref 130437 // Media-Asset Relations
688 506 100 4 0 0
860 607 100 4 120 0
active classdiagram_ref 130437 // Media-Asset Relations
817 506 100 4 0 0
classdiagram_ref 128133 // Session structure
688 506 100 4 60 0
classdiagram_ref 128389 // Render Entities
688 506 100 4 120 0
objectdiagram_ref 128901 // EDL Example2
688 506 100 4 132 0
objectdiagram_ref 128773 // EDL Example1
688 506 100 4 0 0
active objectdiagram_ref 129029 // Engine Example1
860 633 100 4 28 0
end
show_stereotypes
selected objectdiagram_ref 129029 // Engine Example1
selected classdiagram_ref 130437 // Media-Asset Relations
open
package_ref 128005 // design
package_ref 128005 // design
class_ref 136453 // Asset
operation_ref 133125 // getID
operation_ref 132357 // reg
class_ref 136709 // Media
class_ref 138501 // CompoundMedia
class_ref 137349 // Clip
class_ref 138501 // SpecialWish
classview_ref 128005 // Session
package_ref 128389 // RenderEngine
usecaseview_ref 128005 // Renderengine Use
package_ref 128389 // RenderEngine
class_ref 135685 // Logic
class_ref 135813 // Config
class_ref 135941 // State

View file

@ -558,6 +558,9 @@ is how to implement the relationship between [[MObject]]s and Assets. Do we use
For every Asset we generate a __Ident tuple__ and a long ID (hash) derived from this Ident tuple. The constructor of the abstract base class {{{Asset}}} takes care of this step and automatically registeres the new Asset object with the AssetManager. Typically, the factory methods for concrete Asset classes provide some shortcuts providing sensible default values for some of the Ident tuple data fields. They may take additional parameters &amp;mdash; for example the factory method for creating {{{asset::Media}}} takes a filename (and may at some point in the future aply &quot;magic&quot; based on examination of the file)</pre>
</div>
<div title="AssetManager" modifier="Ichthyostega" created="200709200300" changecount="1">
<pre>The Asset Manager provides an Interface to some internal Database holding all Assets in the current Session and System state. It may be a real Database at some point (and for the moment it's a Hashtable). Each [[Asset]] is registered automatically with the Asset Manager; it can be queried either by it's //identification tuple// or by it's unique ID.</pre>
</div>
<div title="Automation" modifier="Ichthyostega" modified="200708100315" created="200706250751" tags="def" changecount="5">
<pre>Automation is treated as a function over time. It is always tied to a specific Parameter (which can thus be variable over the course of the timeline). All details //how// this function is defined are completely abstracted away. The Parameter uses a ParamProvider to get the value for a given Time (point). Typically, this will use linear or bezier interpolation over a set of keyframes internally. Parameters can be configured to have different value ranges and distribution types (on-off, stepped, continuous, bounded)
@ -948,13 +951,14 @@ For this Cinelerra3 design, we could consider making GOP just another raw media
&amp;rarr;see in [[Wikipedia|http://en.wikipedia.org/wiki/Group_of_pictures]]
</pre>
</div>
<div title="ImplementationDetails" modifier="Ichthyostega" modified="200709040256" created="200708080322" tags="overview" changecount="6">
<div title="ImplementationDetails" modifier="Ichthyostega" modified="200709200223" created="200708080322" tags="overview" changecount="7">
<pre>This wiki page is the entry point to detail notes covering some technical decisions, details and problems encountered in the course of the implementation of the Cinelerra Renderengine, the Builder and the related parts.
* [[Packages, Interfaces and Namespaces|InterfaceNamespaces]]
* [[Memory Management Issues|MemoryManagement]]
* [[Creating and registering Assets|AssetCreation]]
* [[Creating new Objects|ObjectCreation]]
* [[Multichannel Media|MultichannelMedia]]
</pre>
</div>
@ -1387,6 +1391,18 @@ For the case in question this seems to be the ''resource allocation is construct
And, last but not least, doing all actual allocations is the job of the backend. Exceptions being long-lived objects, like the Session or the EDL, which are created once and don't bear the danger of causing memory pressure. Besides that, the ProcLayer code shouldn't issue &quot;new&quot; and &quot;delete&quot;, rather it should use some central [[Factories]] for all allocation and freeing, so we can redirect these calls down to the backend, which may use pooling or special placement allocators or the like. The rationale is, for modern hardware/architectures, care has to be taken with heap allocations, esp. with many small objects and irregular usage patterns.
</pre>
</div>
<div title="MultichannelMedia" modifier="Ichthyostega" created="200709200255" tags="design" changecount="2">
<pre>Based on practical experiences, Ichthyo tends to consider Multichannel Media as the base case, while counting media files providing just one single media stream as exotic corner cases. This may seem counter intuitive at first sight; you should think of it as an attempt to avoid right from start some of the common shortcomings found in many video editors, especially
* having to deal with keeping a &quot;link&quot; between audio and video clips
* silly limitations on the supported audio setups (e.g. mono, stereo and 5.1)
* unnecessary complexity when dealing with more realistic setups, esp. when dealing with dialogue scenes
* inability to edit stereoscopic (3D) video in a natural fashion
!Compound Media
Basically, each [[media asset|MediaAsset]] is considered to be a compound of several elementary media (tracks), possibly of various different media kinds. Adding support for placeholders (''proxy clips'') at some point in future will add still more complexity (because then there will be even dependencies between some of these elementary media). We try to keep the structural limitations necessary to be able to handle, edit and render compound media to the bare minimum. This is only possible, if we try to configure as much as possible already at the &quot;asset level&quot; and make the rest of the proc layer behave just according to the configuration given with each asset.
So, when creating a clip out of such a compound media asset, the clip has to be a compound of elementary clips mirroring the given media asset's structure. Besides, it should be possible to //detach// and //attach// elementary clips from a compound clip. On the other hand, the [[Fixture]] created from the current state of the [[EDL]] is explicit to a great extent. So, in the Fixture we deal only with elementary clips placed to absolute positions, and thus the builder will see only simple non-compound clips and translate them into the corresponding source reading nodes.</pre>
</div>
<div title="ObjectCreation" modifier="Ichthyostega" modified="200709040257" created="200709030139" tags="impl design" changecount="10">
<pre>We have to consider carefully how to handle the Creation of new class instances. Because, when done naively, it can defeat all efforts of separating subsystems, or &amp;mdash; the other extreme &amp;mdash; lead to a //switch-on-typeID// programming style. We strive at a solution somewhere in the middle by utilizing __Abstract Factories__ on Interface or key abstraction classes, but providing specialized overloads for the different use cases. So in each use case we have to decide if we want to create a representant of some general concept (Interface), or if we have a direct colaboration and thus need the Factory to provide
a more specific sub-Interface or even a concrete type.