Advertisement
Guest User

Untitled

a guest
Aug 10th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. INSERT  thiblahute  ~  Downloads  gstreamer-playground  ges-slide-composition  git diff   master
  2. diff --git a/ges-slide-composition/main.cpp b/ges-slide-composition/main.cpp
  3. index 29015bd..4d8d1e5 100644
  4. --- a/ges-slide-composition/main.cpp
  5. +++ b/ges-slide-composition/main.cpp
  6. @@ -5,9 +5,9 @@
  7.  
  8. #define INCLUDE_FOREGROUND_VIDEO true
  9.  
  10. -int64_t __cdecl cbQueryPosition(GstElement* nleComposition, GstPipeline* gstPipeline);
  11. +int64_t cbQueryPosition(GstElement* nleComposition, GstPipeline* gstPipeline);
  12. GstElement* getNleCompositionElement(GESTrack* gesTrack);
  13. -bool __cdecl setInt(GESTrackElement* trackElement, const char* name, int32_t value);
  14. +bool setInt(GESTrackElement* trackElement, const char* name, int32_t value);
  15.  
  16. int main(int nargs, char** args)
  17. {
  18. @@ -19,9 +19,9 @@ int main(int nargs, char** args)
  19. uint64_t durationTimeline = numSlides * durationPerSlide;
  20. int32_t canvasHeight = 1080;
  21. int32_t canvasWidth = 1920;
  22. -
  23. +
  24. // This is where the media files are held (relative to executable).
  25. - std::string collateralFolder = "../../collateral/";
  26. + std::string collateralFolder = "../collateral/";
  27. //std::string collateralFolder = "C:/tmp/collateral/";
  28.  
  29. // --------------------
  30. @@ -104,7 +104,7 @@ int main(int nargs, char** args)
  31. GST_ERROR("Failed to add clip to slide layer, uri=%s", uri);
  32. return 1;
  33. }
  34. -
  35. +
  36. // time projection
  37. ges_timeline_element_set_start((GESTimelineElement*)(clip), iSlide*durationPerSlide);
  38. ges_timeline_element_set_duration((GESTimelineElement*)(clip), durationPerSlide);
  39. @@ -227,7 +227,7 @@ int main(int nargs, char** args)
  40. // -------------------
  41. // Run the pipeline
  42. // -------------------
  43. - bool loopShouldTerminate = false;
  44. + bool loopShouldTerminate = false;
  45.  
  46. // Change the state asynchronously.
  47. gst_element_set_state((GstElement*)gstPipeline, GST_STATE_PLAYING);
  48. @@ -241,7 +241,7 @@ int main(int nargs, char** args)
  49. GST_ERROR("Pipeline state should be PLAYING. It is %s.", gst_element_state_get_name(currentState));
  50. gst_element_set_state((GstElement*)gstPipeline, GST_STATE_NULL);
  51. gst_element_get_state((GstElement*)gstPipeline, &currentState, &pendingState, 10 * GST_SECOND);
  52. -
  53. +
  54. GST_INFO("Pipeline stopped");
  55. return 1;
  56. }
  57. @@ -252,6 +252,8 @@ int main(int nargs, char** args)
  58. int output = 0;
  59.  
  60. // Main loop
  61. + ges_timeline_save_to_uri (gesTimeline, "file:///home/thiblahute/test.xges",
  62. + NULL, TRUE, NULL);
  63. gstBus = gst_element_get_bus((GstElement*)gstPipeline);
  64. while (!loopShouldTerminate)
  65. {
  66. @@ -351,7 +353,7 @@ int main(int nargs, char** args)
  67.  
  68. #pragma warning( push )
  69. #pragma warning( disable:4100 ) // formal parameters are not referenced in the method below.
  70. -int64_t __cdecl cbQueryPosition(GstElement* nleComposition, GstPipeline* gstPipeline)
  71. +int64_t cbQueryPosition(GstElement* nleComposition, GstPipeline* gstPipeline)
  72. {
  73. int64_t position;
  74.  
  75. @@ -388,7 +390,7 @@ GstElement* getNleCompositionElement(GESTrack* gesTrack)
  76. {
  77. elementFactoryName = gst_object_get_name(reinterpret_cast<GstObject*>(gstElementFactory));
  78. //if (boost::iequals(factoryName, elementFactoryName))
  79. - if(0==std::strcmp("nlecomposition", elementFactoryName))
  80. + if(!g_strcmp0("nlecomposition", elementFactoryName))
  81. {
  82. output = gstElement;
  83. done = true;
  84. @@ -409,10 +411,10 @@ GstElement* getNleCompositionElement(GESTrack* gesTrack)
  85. return output;
  86. }
  87.  
  88. -bool __cdecl setInt(GESTrackElement* trackElement, const char* name, int32_t value)
  89. +bool setInt(GESTrackElement* trackElement, const char* name, int32_t value)
  90. {
  91. bool output = true;
  92. -
  93. +
  94. GValue val = G_VALUE_INIT;
  95.  
  96. g_value_init(&val, G_TYPE_INT);
  97. @@ -423,4 +425,4 @@ bool __cdecl setInt(GESTrackElement* trackElement, const char* name, int32_t val
  98. output = false;
  99. }
  100. return output;
  101. -}
  102. \ No newline at end of file
  103. +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement