Kaydet (Commit) e8fcf115 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Change glTF mime type: {application -> model}/vnd.gltf+json

There is no an accepted mime type for glTF models yet, so
follow collada's mime type: model/vnd.collada+xml.

Change-Id: I1e23a95dbb0caea781dade819f8e08235cb5c1dc
üst 653bac18
......@@ -46,7 +46,7 @@ class ResMgr;
#define AVMEDIA_MIMETYPE_COMMON "application/vnd.sun.star.media"
#if HAVE_FEATURE_GLTF
#define AVMEDIA_MIMETYPE_JSON "application/vnd.gltf+json"
#define AVMEDIA_MIMETYPE_JSON "model/vnd.gltf+json"
#endif
......
......@@ -713,6 +713,7 @@ void SdFiltersTest::testMediaEmbedding()
{
SvtMiscOptions().SetExperimentalMode(true);
::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"));
xDocShRef = saveAndReload( xDocShRef, ODP );
SdDrawDocument *pDoc = xDocShRef->GetDoc();
CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
......@@ -724,7 +725,7 @@ void SdFiltersTest::testMediaEmbedding()
SdrMediaObj *pModelObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 2 ));
CPPUNIT_ASSERT_MESSAGE( "missing model", pModelObj != NULL);
CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Model/jeep/jeep.json" ), pModelObj->getMediaProperties().getURL());
CPPUNIT_ASSERT_EQUAL( OUString( "application/vnd.gltf+json" ), pModelObj->getMediaProperties().getMimeType());
CPPUNIT_ASSERT_EQUAL( OUString( "model/vnd.gltf+json" ), pModelObj->getMediaProperties().getMimeType());
// Check the case when experimental mode is disabled
xDocShRef->DoClose();
......
......@@ -310,7 +310,7 @@ SdrMediaObj* View::Insert3DModelURL(
if (!bRet) { return 0; }
}
SdrMediaObj* pRetObject = InsertMediaObj( sRealURL, "application/vnd.gltf+json", rAction, rPos, rSize );
SdrMediaObj* pRetObject = InsertMediaObj( sRealURL, "model/vnd.gltf+json", rAction, rPos, rSize );
avmedia::MediaItem aItem = pRetObject->getMediaProperties();
aItem.setLoop(true);
pRetObject->setMediaProperties(aItem);
......
......@@ -3275,7 +3275,7 @@ void XMLShapeExport::ImpExportMediaShape(
OUString const persistentURL =
lcl_StoreMediaAndGetURL(GetExport(), xPropSet, aMediaURL, sMimeType);
#if HAVE_FEATURE_GLTF
if( sMimeType == "application/vnd.gltf+json" )
if( sMimeType == "model/vnd.gltf+json" )
lcl_StoreJsonExternalsAndFallback(GetExport(), xPropSet, aMediaURL);
#endif
......
......@@ -3082,7 +3082,7 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen
if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) )
mbMedia = true;
#if HAVE_FEATURE_GLTF
if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.gltf+json" ) && SvtMiscOptions().IsExperimentalMode() )
if( xAttrList->getValueByIndex( n ).equalsAscii( "model/vnd.gltf+json" ) && SvtMiscOptions().IsExperimentalMode() )
mbMedia = true;
#endif
// leave this loop
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment