Re: [Crystal-cvs] SF.net SVN: crystal:[39042] CS/branches/soc2011/videodecode

res <[email protected]>
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <[email protected]>
On 07.01.2013 15:22, [email protected] wrote:
> - Put the decoder-related interfaces into CS::Material.

CS::Material seems a slightly off choice for video decoding... sure,
technically it decodes video onto a texture, yet the scope for all the
interface seems broader...
Of the existing namespaces, CS::Graphics seems an alternative, but even
that doesn't feel like a real fit.
Perhaps add a new namespace CS::Media?

> +struct MediaLanguage
> +{
> +  /**
> +    * The name of the language
> +    */
> +  char* name;
> +  char* path;

Couldn't these be ‘const char*’s?

> +  virtual void GetAudioTarget (csRef<iSndSysStream> &stream) = 0;

The more common way (in CS) to handle this stuff is a method returning
csPtr<>.

> +  virtual bool GetLanguage (size_t index, MediaLanguage &lang) const = 0;
> +  virtual void SetLanguage (const char* identifier) = 0;

GetLanguage()/SetLanguage() _look_ like a getter/setter for the same
thing, but in fact they aren't.
I recommend renaming at least one of them – e.g. GetLanguage() to
“GetAvailableLanguage()”, or SetLanguage() to “SetActiveLanguage()” or so.

> +  virtual void Create (csString path, csArray<MediaLanguage> languages) = 0;

Passing csString or csArray<> across plugin boundaries is generally not
a good idea – it opens the door for issues caused by binary layout
mismatches or memory allocator mismatches (typically if you mix release
and debug binaries).
Better: “const char*” for path, and for languages, a const
MediaLanguage* argument and a count index.

> +  virtual void InitializePlayer (csRef<iMediaContainer> media, size_t cacheSize = 1) = 0;

Typically, csRef<iMediaContainer> typed args can also be specified with
the type iMediaContainer*. (A handful less calls into the
iMediaContainer instance.)

-f.r.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412

_______________________________________________
Crystal-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-develop
signature.asc (application/pgp-signature, 261 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDrFkQACgkQNCTzcE/07exJCACgsx5XaJI/qL7PK2E8zjt6nmZW
yswAnjauNSzKCz9GtfvEWRXQDNa982ZF
=4Ci8
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.