52 public: |
52 public: |
53 DirectShowMediaType() { memset(this, 0, sizeof(DirectShowMediaType)); } |
53 DirectShowMediaType() { memset(this, 0, sizeof(DirectShowMediaType)); } |
54 DirectShowMediaType(const AM_MEDIA_TYPE &type) { copy(this, type); } |
54 DirectShowMediaType(const AM_MEDIA_TYPE &type) { copy(this, type); } |
55 DirectShowMediaType(const DirectShowMediaType &other) { copy(this, other); } |
55 DirectShowMediaType(const DirectShowMediaType &other) { copy(this, other); } |
56 DirectShowMediaType &operator =(const AM_MEDIA_TYPE &type) { |
56 DirectShowMediaType &operator =(const AM_MEDIA_TYPE &type) { |
57 free(this); copy(this, type); return *this; } |
57 freeData(this); copy(this, type); return *this; } |
58 DirectShowMediaType &operator =(const DirectShowMediaType &other) { |
58 DirectShowMediaType &operator =(const DirectShowMediaType &other) { |
59 free(this); copy(this, other); return *this; } |
59 freeData(this); copy(this, other); return *this; } |
60 ~DirectShowMediaType() { freeData(this); } |
60 ~DirectShowMediaType() { freeData(this); } |
61 |
61 |
62 void clear() { freeData(this); memset(this, 0, sizeof(DirectShowMediaType)); } |
62 void clear() { freeData(this); memset(this, 0, sizeof(DirectShowMediaType)); } |
63 |
63 |
64 static void copy(AM_MEDIA_TYPE *target, const AM_MEDIA_TYPE &source); |
64 static void copy(AM_MEDIA_TYPE *target, const AM_MEDIA_TYPE &source); |